a guest Apr 16th, 2018 61 Never
- # 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)
RAW Paste Data