Python javax.swing.JFrame() Examples

The following are 4 code examples of javax.swing.JFrame(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module javax.swing , or try the search function .
Example #1
Source File: main.py    From aws-extender with MIT License 5 votes vote down vote up
def show_errors(self, label):
        """Display error messages."""
        top_label = JLabel(label, JLabel.CENTER)

        frame = JFrame(self.ext_name)
        frame.setSize(550, 300)
        frame.setLayout(GridLayout(1, 1))

        frame.add(top_label)
        frame.setLocationRelativeTo(None)
        frame.setVisible(True) 
Example #2
Source File: swing.py    From medicare-demo with Apache License 2.0 5 votes vote down vote up
def test(panel, size=None, name='Swing Tester'):
    f = swing.JFrame(name, windowClosing=lambda event: sys.exit(0))
    if hasattr(panel, 'init'):
        panel.init()

    f.contentPane.add(panel)
    f.pack()
    if size is not None:
        from java import awt
        f.setSize(apply(awt.Dimension, size))
    f.setVisible(1)
    return f 
Example #3
Source File: swing.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test(panel, size=None, name='Swing Tester'):
    f = swing.JFrame(name, windowClosing=lambda event: sys.exit(0))
    if hasattr(panel, 'init'):
        panel.init()

    f.contentPane.add(panel)
    f.pack()
    if size is not None:
        from java import awt
        f.setSize(apply(awt.Dimension, size))
    f.setVisible(1)
    return f 
Example #4
Source File: swing.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test(panel, size=None, name='Swing Tester'):
    f = swing.JFrame(name, windowClosing=lambda event: sys.exit(0))
    if hasattr(panel, 'init'):
        panel.init()

    f.contentPane.add(panel)
    f.pack()
    if size is not None:
        from java import awt
        f.setSize(apply(awt.Dimension, size))
    f.setVisible(1)
    return f