本文整理汇总了Python中java.awt.GridBagLayout方法的典型用法代码示例。如果您正苦于以下问题:Python awt.GridBagLayout方法的具体用法?Python awt.GridBagLayout怎么用?Python awt.GridBagLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt
的用法示例。
在下文中一共展示了awt.GridBagLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: p_build_ui
# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import GridBagLayout [as 别名]
def p_build_ui(self, event):
"""
Adds a list of checkboxes, one for each loaded plugin
to the Selct plugins window
"""
if not self.loaded_p_list:
self.update_scroll("[!!] No plugins loaded!")
return
scroll_pane = JScrollPane()
scroll_pane.setPreferredSize(Dimension(200, 250))
check_frame = JPanel(GridBagLayout())
constraints = GridBagConstraints()
constraints.fill = GridBagConstraints.HORIZONTAL
constraints.gridy = 0
constraints.anchor = GridBagConstraints.FIRST_LINE_START
for plug in self.loaded_p_list:
check_frame.add(JCheckBox(plug.get_name(), plug.enabled,
actionPerformed=self.update_box),
constraints)
constraints.gridy += 1
vport = JViewport()
vport.setView(check_frame)
scroll_pane.setViewport(vport)
self.window.contentPane.add(scroll_pane)
self.window.pack()
self.window.setVisible(True)
示例2: __init__
# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import GridBagLayout [as 别名]
def __init__(self, frame, **defaults):
self.frame = frame
self.gridbag = awt.GridBagLayout()
self.defaults = defaults
frame.setLayout(self.gridbag)