Skip to content

Instantly share code, notes, and snippets.

@freakboy3742
Last active May 1, 2017 17:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freakboy3742/629b5bde00aa418e10d5ff881e53c410 to your computer and use it in GitHub Desktop.
Save freakboy3742/629b5bde00aa418e10d5ff881e53c410 to your computer and use it in GitHub Desktop.
Abusing Python for fun and profit
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