Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from javax.swing import JButton, JFrame, JOptionPane
- class HelloWorld(JFrame):
- def __init__(self):
- super(HelloWorld, self).__init__("Hello, Jython!")
- self.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
- self.setSize(300, 300)
- button = JButton("Click Me!", actionPerformed=self.clickMeClicked)
- self.add(button)
- self.visible = True
- def clickMeClicked(self, event):
- print "You clicked Click Me!"
- JOptionPane.showMessageDialog(self, "You clicked Click Me!")
- if __name__ == "__main__":
- HelloWorld()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement