Sha256: 308321906cd1137b26848111860092bb9e9e613dcbbac6bc925ca5d8df0701c2
Contents?: true
Size: 726 Bytes
Versions: 5
Compression:
Stored size: 726 Bytes
Contents
include Java require 'rubygems' require "rubeus" Rubeus::Swing.irb JFrame.new("Rubeus Swing Example 01") do |frame| frame.layout = BoxLayout.new(:Y_AXIS) JSplitPane.new(JSplitPane::VERTICAL_SPLIT) do JPanel.new do |panel| panel.layout = BoxLayout.new(:X_AXIS) @text_field = JTextField.new do |event| if event.key_code == 10 # RETURN @textpane.text += @text_field.text + "\n" @text_field.text = '' end end JButton.new("append") do @textpane.text += @text_field.text @text_field.text = '' end end JScrollPane.new(:preferred_size => [400, 250]) do |pane| @textpane = JTextPane.new end end frame.visible = true end
Version data entries
5 entries across 5 versions & 1 rubygems