Class: Java::JavaxSwing::JTextArea

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

Overview

include Java

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.

#


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/swing_paradise/java_classes/jtextarea/jtextarea.rb', line 53

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

#make_border(use_this_colour = Color::BLACK, width_of_the_border = 3) ⇒ Object

#

make_border

#


31
32
33
34
35
36
37
38
# File 'lib/swing_paradise/java_classes/jtextarea/jtextarea.rb', line 31

def make_border(
    use_this_colour     = Color::BLACK,
    width_of_the_border = 3
  )
  setBorder(
    BorderFactory.createLineBorder(use_this_colour, width_of_the_border)
  )
end

#text?Boolean

#

text?

#

Returns:

  • (Boolean)


43
44
45
# File 'lib/swing_paradise/java_classes/jtextarea/jtextarea.rb', line 43

def text?
  getText
end

#x_y_width_height(x = 200, y = 320, width = 600, height = 350) ⇒ Object

#

x_y_width_height

#


19
20
21
22
23
24
25
26
# File 'lib/swing_paradise/java_classes/jtextarea/jtextarea.rb', line 19

def x_y_width_height(
    x      = 200,
    y      = 320,
    width  = 600,
    height = 350
  )
  setBounds(x, y, width, height) # x, y, width, height
end