Class: Java::JavaxSwing::JButton

Inherits:
Object
  • Object
show all
Defined in:
lib/swing_paradise/jbutton/jbutton.rb

Overview

#

require ‘swing_paradise/jbutton/jbutton.rb’

#

Instance Method Summary collapse

Instance Method Details

#dimensions(hash = { x_axis: 10, y_axis: 20, width: 300, height: 50 }) ⇒ Object

#

dimensions

This is just a wrapper over setBounds() to allow us to work with a Hash instead.

#


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/swing_paradise/jbutton/jbutton.rb', line 29

def dimensions(
    hash = {
      x_axis:  10,
      y_axis:  20,
      width:  300,
      height:  50
    }
  )
  # is: x-coordinate, y-coordinate, width, height)
  setBounds(
    hash[:x_axis],
    hash[:y_axis],
    hash[:width],
    hash[:height]
  )
end