Skip to content

Instantly share code, notes, and snippets.

@spudtrooper
Created March 1, 2011 21:21
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 spudtrooper/849926 to your computer and use it in GitHub Desktop.
Save spudtrooper/849926 to your computer and use it in GitHub Desktop.
Pops up a little window programmatically.
#!/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