Java Reference
In-Depth Information
Figure 5.22
TextBox
indicate that the entire text will be selected when the
TextBox
gains the focus,
using the
selectOnFocus
Boolean variable. In addition, you can specify an
action
function that is invoked when an action is fired on the
TextBox
. Typi-
cally, this is done when the user presses the Enter key.
There are two variables that hold the text,
text
and
value
. On supported plat-
forms, the variable text is updated as the user types. The variable value is
updated when the user commits the changed text on the
TextBox
. Typically, this
is when the user presses the Enter key or changes focus.
The
TextBox
skin implements the visual appearance for the
TextBox
and Table 5.2
defines the CSS attributes that are supported by the
TextBox
skin. The only way
to change these from the default is to use one of the CSS style sheet mechanisms
previously discussed. You can either use a style sheet and give its URL location
to the
Scene
object, or include a style string using the
TextBox
's
style
variable.
Ta b l e 5 . 2
TextBox CSS Attributes
CSS Attribute
JavaFX Attribute
Type
Default Value
padding-left
paddingLeft
Number
4
padding-top
paddingTop
Number
4
padding-bottom
paddingBottom
Number
4
padding-right
paddingRight
Number
4
border-radius
borderRadius
Number
0
border-width
borderWidth
Number
1
continues
Search WWH ::
Custom Search