Skip to content

Instantly share code, notes, and snippets.

@miyakawataku
Created November 2, 2011 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miyakawataku/1333483 to your computer and use it in GitHub Desktop.
Save miyakawataku/1333483 to your computer and use it in GitHub Desktop.
Swing example on Kink
#!/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