Class: Example
- Defined in:
- lib/roebe/jruby/swing/tooltip_example.rb,
lib/roebe/jruby/swing/quit_button_example.rb,
lib/roebe/jruby/swing/two_buttons_example.rb,
lib/roebe/jruby/swing/simple_swing_example.rb,
lib/roebe/jruby/swing/complete_windows_example.rb,
lib/roebe/jruby/swing/absolute_positioning_example.rb
Constant Summary collapse
- WIDTH =
#
WIDTH
#
500
- PANEL_TOOLTIP_TEXT =
#
PANEL_TOOLTIP_TEXT
#
'A Panel container'
- USE_THIS_AS_THE_TOOLTIP_TEXT_FOR_THE_BUTTON =
#
USE_THIS_AS_THE_TOOLTIP_TEXT_FOR_THE_BUTTON
#
'A button component - (Ruby version in use is: '+RUBY_VERSION.to_s+')'
- BASE_IMG_DIR =
BASE_IMG_DIR
'/home/x/data/images/'
Instance Method Summary collapse
-
#connect_skeleton ⇒ Object
# === connect_skeleton ========================================================================= #.
-
#create_skeleton ⇒ Object
# === create_skeleton ========================================================================= #.
-
#img1? ⇒ Boolean
# === img1? ========================================================================= #.
-
#img2? ⇒ Boolean
# === img2? ========================================================================= #.
-
#img3? ⇒ Boolean
# === img3? ========================================================================= #.
-
#initialize ⇒ Example
constructor
# === initialize ========================================================================= #.
-
#reset ⇒ Object
# === reset ========================================================================= #.
-
#run ⇒ Object
# === run ========================================================================= #.
Constructor Details
Instance Method Details
#connect_skeleton ⇒ Object
#
connect_skeleton
#
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/roebe/jruby/swing/tooltip_example.rb', line 55 def connect_skeleton panel = JPanel.new getContentPane.add(panel) panel.setLayout(nil) panel.setToolTipText(PANEL_TOOLTIP_TEXT) # ======================================================================= # # Create the button next - it will be an instance of # Java::JavaxSwing::JButton # ======================================================================= # = JButton.new( 'Button showcasing a tooltip (Ruby version in use is: '+RUBY_VERSION.to_s+')' ) .setBounds(100, 60, 100, 30) # ======================================================================= # # Set a tool tip next: # ======================================================================= # .hint = USE_THIS_AS_THE_TOOLTIP_TEXT_FOR_THE_BUTTON panel.add() setDefaultCloseOperation(JFrame::EXIT_ON_CLOSE) setLocationRelativeTo nil set_visible(true) end |
#create_skeleton ⇒ Object
#
create_skeleton
#
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/roebe/jruby/swing/quit_button_example.rb', line 28 def create_skeleton panel = JPanel.new # This is of class Java::JavaxSwing::JPanel getContentPane.add panel panel.setLayout nil = JButton.new 'Quit' .setBounds 50, 60, 80, 30 .add_action_listener { |event| System.exit 0 } panel << setDefaultCloseOperation JFrame::EXIT_ON_CLOSE setSize 300, 200 setLocationRelativeTo nil setVisible true end |
#img1? ⇒ Boolean
#
img1?
#
21 22 23 |
# File 'lib/roebe/jruby/swing/absolute_positioning_example.rb', line 21 def img1? BASE_IMG_DIR+'LIFESTYLE1.jpg' end |
#img2? ⇒ Boolean
#
img2?
#
28 29 30 |
# File 'lib/roebe/jruby/swing/absolute_positioning_example.rb', line 28 def img2? BASE_IMG_DIR+'LIFESTYLE2.jpg' end |
#img3? ⇒ Boolean
#
img3?
#
35 36 37 |
# File 'lib/roebe/jruby/swing/absolute_positioning_example.rb', line 35 def img3? BASE_IMG_DIR+'KONTAKT1.jpg' end |