当前位置: 首页>>代码示例>>Python>>正文


Python swing.JButton方法代码示例

本文整理汇总了Python中javax.swing.JButton方法的典型用法代码示例。如果您正苦于以下问题:Python swing.JButton方法的具体用法?Python swing.JButton怎么用?Python swing.JButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing的用法示例。


在下文中一共展示了swing.JButton方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [as 别名]
def __init__(self, extender):
        # Initialize self
        super(ActionsPanel, self).__init__()
        self.extender = extender
        self.setLayout(GridLayout(2, 1))
        # Create children
        self.title = JLabel('Actions')
        self.actions = JPanel(GridLayout(1, 3))
        self.start = JButton('Start')
        self.info = JButton('Info')
        # Configure children
        self.title.setFont(Fonts.Heading)
        self.title.setForeground(Colors.Orange)
        self.actions.layout.vgap = 0
        self.actions.layout.hgap = 0
        self.start.addActionListener(StartActionListener(extender))
        self.info.addActionListener(InfoActionListener(extender))
        # Add children
        self.add(self.title)
        self.add(self.actions)
        self.actions.add(self.start)
        self.actions.add(self.info) 
开发者ID:penafieljlm,项目名称:burp-tracer,代码行数:24,代码来源:tracer.py

示例2: __init__

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [as 别名]
def __init__(self, callbacks, log):
        self.callbacks = callbacks
        self.log = log
        self.log_table = None # to be set by caller

        self.setLayout(BoxLayout(self, BoxLayout.PAGE_AXIS))

        label = JLabel("Reload from Git Repo:")
        button = JButton("Reload")
        button.addActionListener(CommandPanel.ReloadAction(log))
        self.add(label)
        self.add(button)

        label = JLabel("Send selected entries to respective Burp tools:")
        button = JButton("Send")
        button.addActionListener(CommandPanel.SendAction(self))
        self.add(label)
        self.add(button)

        label = JLabel("Remove selected entries from Git Repo:")
        button = JButton("Remove")
        button.addActionListener(CommandPanel.RemoveAction(self, log))
        self.add(label)
        self.add(button)

        # TODO: maybe add a git command box 
开发者ID:jfoote,项目名称:burp-git-bridge,代码行数:28,代码来源:burp_git_bridge.py

示例3: createButton

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [as 别名]
def createButton(self, text, command):
        """Generate a new button with a given text and command"""
        button = JButton(text)
        button.setAlignmentX(Component.CENTER_ALIGNMENT)
        button.setActionCommand(command)
        button.addActionListener(self._button_listener)
        return button 
开发者ID:nccgroup,项目名称:blackboxprotobuf,代码行数:9,代码来源:typedef_editor.py

示例4: createButton

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [as 别名]
def createButton(self, text, command):
        """Generate new button with the given text and command string"""
        button = JButton(text)
        button.setAlignmentX(Component.CENTER_ALIGNMENT)
        button.setActionCommand(command)
        button.addActionListener(self._button_listener)
        return button 
开发者ID:nccgroup,项目名称:blackboxprotobuf,代码行数:9,代码来源:typedef_tab.py

示例5: createButton

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [as 别名]
def createButton(self, text, command):
        """Create a new button with the given text and command"""
        button = JButton(text)
        button.setAlignmentX(Component.CENTER_ALIGNMENT)
        button.setActionCommand(command)
        button.addActionListener(self._button_listener)
        return button 
开发者ID:nccgroup,项目名称:blackboxprotobuf,代码行数:9,代码来源:editor.py

示例6: __init__

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [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) 
开发者ID:doyensec,项目名称:inql,代码行数:17,代码来源:omnibar.py

示例7: test_java_bean_properties

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [as 别名]
def test_java_bean_properties(self):

        b1 = swing.JButton()
        b1.label = 'foo'
        b2 = swing.JButton(label='foo')
        self.assertEquals(b1.label, b2.label)
        self.assertEquals(b1.label, 'foo')

        # Test bean event properties - single and multiple
        def testAction(event):
            JythonBasicTests.flag += 1

        doit = ActionEvent(b1, ActionEvent.ACTION_PERFORMED, "")

        b1.actionPerformed = testAction
        JythonBasicTests.flag = 0
        b1.doClick()
        self.assertEquals(
            JythonBasicTests.flag, 1,
            'expected one action per event but got %s' % JythonBasicTests.flag)

        b1.actionPerformed.append(testAction)
        JythonBasicTests.flag = 0
        b1.doClick()
        self.assertEquals(JythonBasicTests.flag, 2, 'two actions per event')

        b1.actionPerformed = testAction
        JythonBasicTests.flag = 0
        b1.doClick()
        self.assertEquals(JythonBasicTests.flag, 1,
                          'one actions per event - again') 
开发者ID:Acmesec,项目名称:CTFCrackTools-V2,代码行数:33,代码来源:test_jbasic.py

示例8: build_gui

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [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 
开发者ID:VirtueSecurity,项目名称:aws-extender,代码行数:44,代码来源:main.py

示例9: initUI

# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JButton [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)
                )
            )
        ) 
开发者ID:InitRoot,项目名称:BurpJSLinkFinder,代码行数:49,代码来源:FransLinkfinder.py


注:本文中的javax.swing.JButton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。