本文整理汇总了Python中javax.swing.JCheckBox.setAlignmentX方法的典型用法代码示例。如果您正苦于以下问题:Python JCheckBox.setAlignmentX方法的具体用法?Python JCheckBox.setAlignmentX怎么用?Python JCheckBox.setAlignmentX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JCheckBox
的用法示例。
在下文中一共展示了JCheckBox.setAlignmentX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PreferencesFrame
# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import setAlignmentX [as 别名]
class PreferencesFrame(JFrame, ActionListener, WindowListener, ItemListener, HyperlinkListener):
"""Dialog with preferences
"""
def __init__(self, parent, title, app):
from javax.swing import JCheckBox, JRadioButton, ButtonGroup
self.app = app
border = BorderFactory.createEmptyBorder(5, 7, 5, 7)
self.getContentPane().setBorder(border)
self.getContentPane().setLayout(BorderLayout(0, 5))
self.tabbedPane = JTabbedPane()
#1 Tab: general
panel1 = JPanel()
panel1.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7))
panel1.setLayout(BoxLayout(panel1, BoxLayout.PAGE_AXIS))
#Checkbutton to enable/disable update check when script starts
self.updateCBtn = JCheckBox(self.app.strings.getString("updateCBtn"))
self.updateCBtn.setToolTipText(self.app.strings.getString("updateCBtn_tooltip"))
#Download tools
downloadBtn = JButton(self.app.strings.getString("updatesBtn"),
ImageProvider.get("dialogs", "refresh"),
actionPerformed=self.on_downloadBtn_clicked)
downloadBtn.setToolTipText(self.app.strings.getString("updatesBtn_tooltip"))
#Checkbuttons for enabling/disabling tools
toolsPanel = JPanel(BorderLayout(0, 5))
title = self.app.strings.getString("enable_disable_tools")
toolsPanel.setBorder(BorderFactory.createTitledBorder(title))
infoLbl = JLabel(self.app.strings.getString("JOSM_restart_warning"))
infoLbl.setFont(infoLbl.getFont().deriveFont(Font.ITALIC))
toolsPanel.add(infoLbl, BorderLayout.PAGE_START)
toolsStatusPane = JPanel(GridLayout(len(self.app.realTools), 0))
self.toolsCBtns = []
for tool in self.app.realTools:
toolCBtn = JCheckBox()
toolCBtn.addItemListener(self)
toolLbl = JLabel(tool.title, tool.bigIcon, JLabel.LEFT)
self.toolsCBtns.append(toolCBtn)
toolPane = JPanel()
toolPane.setLayout(BoxLayout(toolPane, BoxLayout.X_AXIS))
toolPane.add(toolCBtn)
toolPane.add(toolLbl)
toolsStatusPane.add(toolPane)
toolsPanel.add(toolsStatusPane, BorderLayout.CENTER)
#Radiobuttons for enabling/disabling layers when a new one
#is added
layersPanel = JPanel(GridLayout(0, 1))
title = self.app.strings.getString("errors_layers_manager")
layersPanel.setBorder(BorderFactory.createTitledBorder(title))
errorLayersLbl = JLabel(self.app.strings.getString("errors_layers_info"))
errorLayersLbl.setFont(errorLayersLbl.getFont().deriveFont(Font.ITALIC))
layersPanel.add(errorLayersLbl)
self.layersRBtns = {}
group = ButtonGroup()
for mode in self.app.layersModes:
layerRBtn = JRadioButton(self.app.strings.getString("%s" % mode))
group.add(layerRBtn)
layersPanel.add(layerRBtn)
self.layersRBtns[mode] = layerRBtn
#Max number of errors text field
self.maxErrorsNumberTextField = JTextField()
self.maxErrorsNumberTextField.setToolTipText(self.app.strings.getString("maxErrorsNumberTextField_tooltip"))
self.maxErrorsNumberTFieldDefaultBorder = self.maxErrorsNumberTextField.getBorder()
self.maxErrorsNumberTextField.getDocument().addDocumentListener(ErrNumTextListener(self))
#layout
self.updateCBtn.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(self.updateCBtn)
panel1.add(Box.createRigidArea(Dimension(0, 15)))
downloadBtn.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(downloadBtn)
panel1.add(Box.createRigidArea(Dimension(0, 15)))
toolsPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(toolsPanel)
panel1.add(Box.createRigidArea(Dimension(0, 15)))
layersPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(layersPanel)
panel1.add(Box.createRigidArea(Dimension(0, 15)))
maxErrP = JPanel(BorderLayout(5, 0))
maxErrP.add(JLabel(self.app.strings.getString("max_errors_number")), BorderLayout.LINE_START)
maxErrP.add(self.maxErrorsNumberTextField, BorderLayout.CENTER)
p = JPanel(BorderLayout())
p.add(maxErrP, BorderLayout.PAGE_START)
p.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(p)
self.tabbedPane.addTab(self.app.strings.getString("tab_1_title"),
None,
panel1,
None)
#2 Tab: favourite zones
panel2 = JPanel(BorderLayout(5, 15))
panel2.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7))
#.........这里部分代码省略.........