本文整理汇总了Python中javax.swing.JPanel方法的典型用法代码示例。如果您正苦于以下问题:Python swing.JPanel方法的具体用法?Python swing.JPanel怎么用?Python swing.JPanel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing
的用法示例。
在下文中一共展示了swing.JPanel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JPanel [as 别名]
def __init__(self, extender):
# Initialize self
super(TitlePanel, self).__init__()
self.extender = extender
self.setLayout(GridLayout(2, 1))
# Create children
self.title = JLabel('Tracer')
self.subtitle = JPanel()
self.label = JLabel('Allows you to trace where inputs are reflected back to the user. Click "Start" to analyze the current site map.')
# Configure children
self.title.setFont(Fonts.Heading)
self.title.setForeground(Colors.Orange)
self.subtitle.layout.hgap = 0
# Add children
self.add(self.title)
self.add(self.subtitle)
self.subtitle.add(self.label)
示例2: createButtonPane
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JPanel [as 别名]
def createButtonPane(self):
"""Create a new button pane with the type editor window"""
self._button_listener = TypeEditorButtonListener(self)
panel = JPanel()
panel.setLayout(BoxLayout(panel, BoxLayout.Y_AXIS))
panel.add(self.createButton("Validate", "validate"))
panel.add(self.createButton("Apply", "apply"))
panel.add(self.createButton("Reset", "reset"))
panel.add(self.createButton("Exit", "exit"))
return panel
示例3: createButtonPane
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JPanel [as 别名]
def createButtonPane(self):
"""Create AWT window panel for buttons"""
self._button_listener = TypeDefinitionButtonListener(self)
panel = JPanel()
panel.setLayout(BoxLayout(panel, BoxLayout.Y_AXIS))
panel.add(self.createButton("New Type", "new-type"))
panel.add(self.createButton("Edit Type", "edit-type"))
panel.add(self.createButton("Delete Type", "delete-type"))
panel.add(self.createButton("Save All Types To File", "save-types"))
panel.add(self.createButton("Load All Types To File", "load-types"))
return panel
示例4: createButtonPane
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JPanel [as 别名]
def createButtonPane(self):
"""Create a new button pane for the message editor tab"""
self._button_listener = EditorButtonListener(self)
panel = JPanel()
panel.setLayout(BoxLayout(panel, BoxLayout.Y_AXIS))
if self._editable:
panel.add(self.createButton("Validate", "validate"))
panel.add(self.createButton("Save Type", "save-type"))
panel.add(self.createButton("Load Type", "load-type"))
panel.add(self.createButton("Edit Type", "edit-type"))
panel.add(self.createButton("Reset", "reset"))
return panel
示例5: __init__
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JPanel [as 别名]
def __init__(self, hint=None, label=None, action=None):
if not hint: hint = 'Omnibar hint'
if not label: label = 'Run'
if not action: action = nop_evt
self.this = JPanel()
self.this.setLayout(BorderLayout())
# Add an hinttextfield
self._text = _HintTextField(hint, action)
self.this.add(BorderLayout.CENTER, self._text.this)
# Add a run buttpn
button = JButton(label)
button.addActionListener(action)
self.this.add(BorderLayout.EAST, button)
示例6: build_gui
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JPanel [as 别名]
def build_gui(self):
"""Construct GUI elements."""
panel = JPanel(BorderLayout(3, 3))
panel.setBorder(EmptyBorder(160, 160, 160, 160))
self.aws_access_key_inpt = JTextField(10)
self.aws_secret_key_inpt = JTextField(10)
self.aws_session_token_inpt = JTextField(10)
self.gs_access_key_inpt = JTextField(10)
self.gs_secret_key_inpt = JTextField(10)
self.wordlist_path_inpt = JTextField(10)
self.passive_mode = JCheckBox('Enabled')
self.ssl_verification = JCheckBox('Enabled')
save_btn = JButton('Save', actionPerformed=self.save_config)
labels = JPanel(GridLayout(0, 1))
inputs = JPanel(GridLayout(0, 1))
panel.add(labels, BorderLayout.WEST)
panel.add(inputs, BorderLayout.CENTER)
top_label = JLabel('<html><b>Settings</b><br><br></html>')
top_label.setHorizontalAlignment(JLabel.CENTER)
panel.add(top_label, BorderLayout.NORTH)
labels.add(JLabel('AWS Access Key:'))
inputs.add(self.aws_access_key_inpt)
labels.add(JLabel('AWS Secret Key:'))
inputs.add(self.aws_secret_key_inpt)
labels.add(JLabel('AWS Session Key (optional):'))
inputs.add(self.aws_session_token_inpt)
labels.add(JLabel('GS Access Key:'))
inputs.add(self.gs_access_key_inpt)
labels.add(JLabel('GS Secret Key:'))
inputs.add(self.gs_secret_key_inpt)
labels.add(JLabel('Wordlist Filepath (optional):'))
inputs.add(self.wordlist_path_inpt)
labels.add(JLabel('Passive Mode:'))
inputs.add(self.passive_mode)
labels.add(JLabel('SSL Verification:'))
inputs.add(self.ssl_verification)
panel.add(save_btn, BorderLayout.SOUTH)
return panel
示例7: initUI
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JPanel [as 别名]
def initUI(self):
self.tab = swing.JPanel()
# UI for Output
self.outputLabel = swing.JLabel("LinkFinder Log:")
self.outputLabel.setFont(Font("Tahoma", Font.BOLD, 14))
self.outputLabel.setForeground(Color(255,102,52))
self.logPane = swing.JScrollPane()
self.outputTxtArea = swing.JTextArea()
self.outputTxtArea.setFont(Font("Consolas", Font.PLAIN, 12))
self.outputTxtArea.setLineWrap(True)
self.logPane.setViewportView(self.outputTxtArea)
self.clearBtn = swing.JButton("Clear Log", actionPerformed=self.clearLog)
self.exportBtn = swing.JButton("Export Log", actionPerformed=self.exportLog)
self.parentFrm = swing.JFileChooser()
# Layout
layout = swing.GroupLayout(self.tab)
layout.setAutoCreateGaps(True)
layout.setAutoCreateContainerGaps(True)
self.tab.setLayout(layout)
layout.setHorizontalGroup(
layout.createParallelGroup()
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup()
.addComponent(self.outputLabel)
.addComponent(self.logPane)
.addComponent(self.clearBtn)
.addComponent(self.exportBtn)
)
)
)
layout.setVerticalGroup(
layout.createParallelGroup()
.addGroup(layout.createParallelGroup()
.addGroup(layout.createSequentialGroup()
.addComponent(self.outputLabel)
.addComponent(self.logPane)
.addComponent(self.clearBtn)
.addComponent(self.exportBtn)
)
)
)