本文整理匯總了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)