Class: Swing::JButton
- Inherits:
-
Object
- Object
- Swing::JButton
- Defined in:
- lib/swing/j_button.rb,
lib/swing/old/button.rb
Instance Method Summary collapse
- #add_block_listener(&block) ⇒ Object
-
#initialize(text, opts = {}, &block) ⇒ JButton
constructor
A new instance of JButton.
Constructor Details
#initialize(text, opts = {}, &block) ⇒ JButton
Returns a new instance of JButton.
10 11 12 13 14 15 16 |
# File 'lib/swing/old/button.rb', line 10 def initialize text, opts = {}, &block set_attributes(opts) { super(text) } self.addActionListener ActionListener.new &block opts[:parent].add self if opts[:parent] end |
Instance Method Details
#add_block_listener(&block) ⇒ Object
5 6 7 |
# File 'lib/swing/j_button.rb', line 5 def add_block_listener &block self.addActionListener SwingSupport::ActionListener.new &block end |