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.

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
view raw simple.rb hosted with ❤ by GitHub

 
---

Comment

  1. Can you release it as a an updated gem please? Thanks

    JJ · 2011-11-10 21:25 · #

your_ip_is_blacklisted_by sbl.spamhaus.org

---