Tino APCS

Control Nodes

Overview

Control Nodes are the User Interface (UI) items you add to your program that the user interacts with. Examples are Buttons, Sliders, and TextAreas. Because every kind of control is a descendent of the Node class, they all share common methods. However, you should investigate the API for any particular control you want to use because they also have methods that are specific to each kind of control.

Oracle Resources

Common Control Methods

These methods are inherited from Node, Parent, Region, or Control

Method Description
setTooltip() Pops up a hint when user hovers over this control
setPadding() Puts padding between this control's border and contents
setBorder() Changes the size and style of the Border
setBackground() Changes the size and style of the Background
setMinWidth() setMinHeight() Prevents this pane from being smaller than this when resized or computed
setMaxWidth() setMaxHeight() Prevents this pane from growing larger than this when resized or computed
setPreferredWidth / Height Keeps this pane a fixed size, if possible
setLayoutX / Y Only works if the parent doesn't have layout rules (eg: Group)
setWidth() setHeight() You don't have access to these because they're declared as protected access. Use setPreferredWidth / H

Specific Control Methods

Read the API for any Control you want to use because they each have their own methods. Here are some examples:

Button Methods Description
setText() Sets the Button text
setAlignment() Sets alignment for text within a Button
setTextAlignment() Sets alignment line-wrapping within a Button
setFont() Changes a Button's text Font and style
Slider Methods Description
setMin(), setMax(), setValue() Sets a Sliders min, max, and starting value
setMajorTickUnit() Sets the major tickmark unit (by 5's, 10's, etc.)
setMinorTickCount() Sets how many small tickmarks to display between major ticks
setShowTickMarks() Tickmarks won't show up unless you turn them on
setShowTickLabels() Adds numerical labels the the tickmarks
setSnapToTicks() Slider values snap to the nearest tickmark

Last modified: February 28, 2023

Dark Mode

Outline