Created
March 1, 2011 21:21
-
-
Save spudtrooper/849926 to your computer and use it in GitHub Desktop.
Pops up a little window programmatically.
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 jruby | |
# | |
# Pops up a little alert window. | |
# | |
require 'java' | |
JFrame = javax.swing.JFrame | |
JPanel = javax.swing.JPanel | |
JLabel = javax.swing.JLabel | |
def main(argv) | |
msg = argv.join ' ' | |
f = JFrame.new | |
p = JPanel.new | |
p.add JLabel.new msg | |
f.getContentPane.add p | |
f.setDefaultCloseOperation JFrame::EXIT_ON_CLOSE | |
f.setLocationRelativeTo nil | |
f.pack | |
f.setVisible true | |
f.toFront | |
end | |
main ARGV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment