Skip to content

Instantly share code, notes, and snippets.

@aterai
Created September 16, 2013 11:20
Show Gist options
  • Save aterai/6579399 to your computer and use it in GitHub Desktop.
Save aterai/6579399 to your computer and use it in GitHub Desktop.
Swing Exception
include Java
java_import javax.swing.JScrollPane
java_import javax.swing.JTree
java_import javax.swing.UIManager
java_import javax.swing.WindowConstants
def create_and_show_GUI
# try{
# UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
# }catch(Exception e) { e.printStackTrace(); }
begin
UIManager.look_and_feel = UIManager.system_look_and_feel_class_name
rescue Exception => e
proxied_e = JavaUtilities.wrap e.cause
proxied_e.print_stack_trace
end
frame = javax.swing.JFrame.new "Title"
frame.default_close_operation = WindowConstants::EXIT_ON_CLOSE
frame.content_pane.add JScrollPane.new(JTree.new)
frame.set_size(320, 240)
frame.location_relative_to = nil
frame.visible = true
end
def run
create_and_show_GUI
end
java.awt.EventQueue.invokeLater self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment