Created
November 2, 2011 12:12
-
-
Save miyakawataku/1333483 to your computer and use it in GitHub Desktop.
Swing example on Kink
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
#!/usr/bin/env kink | |
# vim: et sw=4 sts=4 | |
useclass('javax.swing.JFrame') | |
useclass('javax.swing.JButton') | |
useclass('javax.swing.JOptionPane') | |
&BUTTON = JButton.new('Push').via { | |
__.addActionListener { | |
JOptionPane.showMessageDialog(null 'You pushed!') | |
} | |
} | |
&FRAME = JFrame.new("Swingin'").via { | |
__.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) | |
__.getContentPane.add(BUTTON) | |
__.pack | |
__.setSize(200 150) | |
__.setLocationRelativeTo(null) | |
} | |
FRAME.setVisible(true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment