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

Version Path
rubeus-0.0.8-java examples/rubeus_swing_example01.rb
rubeus-0.0.4-java examples/rubeus_swing_example01.rb
rubeus-0.0.6-java examples/rubeus_swing_example01.rb
rubeus-0.0.7-java examples/rubeus_swing_example01.rb
rubeus-0.0.5-java examples/rubeus_swing_example01.rb