JMenuBar Support in Rubeus
I have added JMenuBar
support to Rubeus. It is not released yet, but you can clone the git repo and play with it. The implementation is rather naive, but it works well for my needs.
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
require 'rubygems' | |
require 'java' | |
require 'rubeus' | |
# Rubeus.verbose = true | |
Rubeus::Swing.irb | |
JFrame.new('Hello') do | |
|frame| | |
frame.layout = BoxLayout.new(:Y_AXIS) | |
JSplitPane.new(JSplitPane::HORIZONTAL_SPLIT) do | |
JTree.new | |
JEditorPane.new | |
end | |
frame.jmenu_bar = JMenuBar.new do | |
JMenu.new("File") do | |
JMenuItem.new("New...") do | |
puts 'new' | |
end | |
JMenuItem.new("Exit") do | |
java.lang.System.exit(0) | |
end | |
end | |
end | |
frame.set_size(800, 600) | |
frame.default_close_operation = JFrame::EXIT_ON_CLOSE | |
frame.visible = true | |
end | |
Can you release it as a an updated gem please? Thanks
— JJ · 2011-11-10 21:25 · #