Last active
May 1, 2017 17:15
-
-
Save freakboy3742/629b5bde00aa418e10d5ff881e53c410 to your computer and use it in GitHub Desktop.
Abusing Python for fun and profit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from javax.swing import JFrame, JLabel, SwingUtilities | |
class HelloWorldSwing(implements=java.lang.Runnable): | |
def run(self) -> void: | |
self.createAndShowGUI() | |
def createAndShowGUI(self): | |
frame = JFrame("HelloWorldSwing") | |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) | |
label = JLabel("Hello World") | |
frame.getContentPane().add(label) | |
frame.pack() | |
frame.setVisible(True) | |
class MainThread(extends=java.lang.Thread): | |
@super({target=target, name='main'}) | |
def __init__(self, target: java.lang.Runnable) -> void: | |
pass | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment