UIComponent

floodsim.view.component.UIComponent
See theUIComponent companion trait
object UIComponent

Factory methods for styled Swing components.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def button(text: String, size: Dimension): JButton

Creates a styled JButton with the given text and size.

Creates a styled JButton with the given text and size.

Value parameters

size

button preferred size

text

button text

Attributes

Returns

the styled JButton

def label(text: String, font: Font, align: Int): JLabel

Creates a styled JLabel with the given text, font, and alignment.

Creates a styled JLabel with the given text, font, and alignment.

Value parameters

align

text alignment (e.g. SwingConstants.LEFT)

font

label font

text

label text

Attributes

Returns

the styled JLabel

def panel: JPanel

Creates a styled JPanel with the application background color.

Creates a styled JPanel with the application background color.

Attributes

Returns

the styled JPanel

Extensions

Extensions

extension (button: JButton)
def withAction(action: => Unit): JButton

Registers an action to be performed when the button is clicked.

Registers an action to be performed when the button is clicked.

Value parameters

action

the action to perform

Attributes

Returns

the JButton with the action listener added