Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This is the 'magical Java include line'.
- include Java
- # With the 'include Java' above, we can now refer to things that
- #are part of the standard Java platform via their full paths.
- # Creating a Java JFrame.
- frame = javax.swing.JFrame.new("Window")
- label = javax.swing.JLabel.new("Hello")
- # We can transparently call Java methods on Java objects, just
- # as if they were defined in Ruby.
- frame.getContentPane.add(label) # Invoking the getContentPane
- frame.setDefaultCloseOperation( javax.swing.JFrame::EXIT_ON_CLOSE)
- frame.pack
- frame.setVisible(true)
Add Comment
Please, Sign In to add comment