Basics
Guides
API Reference
Basics
Guides
API Reference
[100:7] extends: Control
ChoiceBox wraps the JavaFX ChoiceBox control, a compact selection widget that shows
the currently selected item and reveals a pop-up list of all choices when clicked.
Unlike ComboBox, ChoiceBox does not support editable text entry and is best suited for
a small, fixed set of options. The style class choice-box is applied by default,
and the control inherits all CSS properties from Control.
The tables below list every CSS property available to ChoiceBox, organized by the
class level where each property is defined. Properties defined at a higher level are
inherited by all subclasses below it.
| Property | Values | Default | Description |
|---|---|---|---|
-fx-skin |
<string> |
null |
Fully qualified class name of the Skin to use for rendering this control. |
-fx-focus-traversable |
true | false |
true |
When true, the control participates in focus traversal via the keyboard Tab key. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-background-color |
<paint> [, <paint>]* |
transparent |
One or more paint values for background fill layers, rendered back to front. |
-fx-background-insets |
<size> or <t> <r> <b> <l> [, ...]* |
0 0 0 0 |
Insets from the region edges for each background fill layer. |
-fx-background-radius |
<size> [/ <size>]* [, ...]* |
0 0 0 0 |
Corner radii for each background fill layer. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-background-image |
<uri> [, <uri>]* |
null |
One or more image URIs for background image layers. |
-fx-background-position |
<bg-position> [, ...]* |
0% 0% |
Position of each background image within the region. Accepts keywords or size values. |
-fx-background-repeat |
<repeat-style> [, ...]* |
repeat repeat |
Tiling behavior for each background image. Values: repeat, no-repeat, round, space applied per axis. |
-fx-background-size |
<bg-size> [, ...]* |
auto auto |
Dimensions for each background image. Supports cover, contain, stretch, or explicit sizes. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-border-color |
<paint> or <t> <r> <b> <l> [, ...]* |
null |
Paint colors for the border stroke layers. |
-fx-border-insets |
<size> or <t> <r> <b> <l> [, ...]* |
null |
Insets from region edges for each border layer. |
-fx-border-radius |
<size> [, ...]* |
null |
Corner radii for border stroke layers. |
-fx-border-style |
<border-style> [, ...]* |
null |
Border line style (solid, dotted, dashed) plus phase and line cap/join options per layer. |
-fx-border-width |
<size> or <t> <r> <b> <l> [, ...]* |
null |
Thickness of each border stroke layer, per side. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-border-image-source |
<uri> [, <uri>]* |
null |
Image URIs used to paint the border. |
-fx-border-image-insets |
<size> or <t> <r> <b> <l> [, ...]* |
0 0 0 0 |
Insets for each border image layer. |
-fx-border-image-repeat |
<repeat-style> [, ...]* |
repeat repeat |
Tiling behavior for each border image. |
-fx-border-image-slice |
<size> or <t> <r> <b> <l> [fill] [, ...]* |
100% |
Divides each border image into nine regions. Adding fill preserves the center region. |
-fx-border-image-width |
<size> or <t> <r> <b> <l> [, ...]* |
1 1 1 1 |
Width of each border image slice per side. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-padding |
<size> or <t> <r> <b> <l> |
0 0 0 0 |
Interior padding between the region border and its content. |
-fx-shape |
<string> |
null |
SVG path string that defines a custom clip shape for the region. |
-fx-scale-shape |
true | false |
true |
When true, the shape is scaled to fit the region. |
-fx-position-shape |
true | false |
true |
When true, the shape is centered within the region. |
-fx-snap-to-pixel |
true | false |
true |
When true, positions and sizes are rounded to whole pixel boundaries. |
-fx-min-width |
<size> |
-1 |
Minimum width. -1 uses the computed minimum. |
-fx-pref-width |
<size> |
-1 |
Preferred width. -1 uses the computed preferred. |
-fx-max-width |
<size> |
-1 |
Maximum width. -1 uses the computed maximum. |
-fx-min-height |
<size> |
-1 |
Minimum height. -1 uses the computed minimum. |
-fx-pref-height |
<size> |
-1 |
Preferred height. -1 uses the computed preferred. |
-fx-max-height |
<size> |
-1 |
Maximum height. -1 uses the computed maximum. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-blend-mode |
add | blue | color-burn | color-dodge | darken | difference | exclusion | green | hard-light | lighten | multiply | overlay | red | screen | soft-light | src-atop | src-in | src-out | src-over |
null |
Blend mode used when compositing this node with nodes beneath it. |
-fx-cursor |
null | crosshair | default | hand | move | e-resize | h-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | v-resize | text | wait | <url> |
null (inherits) |
Mouse cursor shape shown when the pointer is over this node. Inherits from parent by default. |
-fx-effect |
<effect> |
null |
A visual effect (e.g. DropShadow, InnerShadow) applied to the rendered node. |
-fx-focus-traversable |
true | false |
false |
Whether this node participates in focus traversal. Overridden to true by Control. |
-fx-view-order |
<number> |
0 |
Adjusts rendering and hit-test order within the parent without changing the scene graph order. |
-fx-opacity |
<number> [0.0 - 1.0] |
1 |
Opacity of the node. 0 is fully transparent, 1 is fully opaque. |
-fx-rotate |
<number> |
0 |
Rotation angle in degrees applied around the node's center point. Positive values are clockwise. |
-fx-scale-x |
<number> |
1 |
Scale factor along the X axis about the node's center. |
-fx-scale-y |
<number> |
1 |
Scale factor along the Y axis about the node's center. |
-fx-scale-z |
<number> |
1 |
Scale factor along the Z axis about the node's center. |
-fx-translate-x |
<number> |
0 |
Translation offset along the X axis in pixels. |
-fx-translate-y |
<number> |
0 |
Translation offset along the Y axis in pixels. |
-fx-translate-z |
<number> |
0 |
Translation offset along the Z axis in pixels. |
visibility |
visible | hidden | collapse | inherit |
visible |
Controls whether the node is rendered and participates in layout. collapse removes it from layout; hidden keeps the space. |
-fx-managed |
true | false |
true |
When false, the parent layout does not manage this node's position or size. |
ChoiceBox (Val)
Constructor creates a new ChoiceBox object with the provided JavaFX object to set or a list with the available values to set.
Val is a list of strings with the ChoiceBox values.this objectsetItems (list lst)
Sets the available items with the provided list.
lst is a list with the values.this objectgetValue ()
Gets the selected value.
The selected value.onChange (callback OnChange)
Registeres the on change handler with the provided callback. The change handler should take three arguments similar to this function definition. onChoiceBoxChange(ObservableValue, OldValue, NewValue)
OnChange is a callback with the change handler.this objectgetItems ()
Returns the live ObservableList of items backing this ChoiceBox. Mutations to the returned list are reflected directly on the control.
An ObservableList AJO of items.itemsProperty ()
Returns the property holding the ObservableList of items.
An ObjectProperty AJO around the items list.setValue (Val)
Sets the currently selected value.
Val is the value to select.this object for chainingvalueProperty ()
Returns the property holding the current value.
An ObjectProperty AJO around the value.getSelectionModel ()
Returns the underlying SingleSelectionModel.
An AJO around the SingleSelectionModel.setSelectionModel (object Model)
Sets the SingleSelectionModel.
Model is an AJO around a javafx.scene.control.SingleSelectionModel.this object for chainingselectionModelProperty ()
Returns the property holding the SingleSelectionModel.
An ObjectProperty AJO around the selection model.getConverter ()
Returns the StringConverter used to render items as strings.
An AJO around the StringConverter, or null when unset.setConverter (object Conv)
Sets the StringConverter used to render items as strings.
Conv is an AJO around a javafx.util.StringConverter.this object for chainingconverterProperty ()
Returns the property holding the StringConverter.
An ObjectProperty AJO around the StringConverter.show ()
Opens the choice popup.
this object for chaininghide ()
Closes the choice popup.
this object for chainingisShowing ()
Returns true when the popup is currently visible.
A bool.showingProperty ()
Returns the read-only property reporting whether the popup is showing.
A ReadOnlyBooleanProperty AJO.setOnAction (callback Cb)
Registers the EventHandler invoked when the control's value changes.
Cb is a callback that receives the ActionEvent AJO.this object for chaininggetOnAction ()
Returns the EventHandler currently registered for the action event.
An AJO around the EventHandler, or null when unset.onActionProperty ()
Returns the property holding the onAction EventHandler.
An ObjectProperty AJO around the handler.setOnShowing (callback Cb)
Registers the EventHandler invoked just before the popup opens.
Cb is a callback that receives the Event AJO.this object for chaininggetOnShowing ()
Returns the EventHandler registered for the onShowing event.
An AJO around the EventHandler, or null when unset.onShowingProperty ()
Returns the property holding the onShowing EventHandler.
An ObjectProperty AJO around the handler.setOnShown (callback Cb)
Registers the EventHandler invoked just after the popup is shown.
Cb is a callback that receives the Event AJO.this object for chaininggetOnShown ()
Returns the EventHandler registered for the onShown event.
An AJO around the EventHandler, or null when unset.onShownProperty ()
Returns the property holding the onShown EventHandler.
An ObjectProperty AJO around the handler.setOnHiding (callback Cb)
Registers the EventHandler invoked just before the popup hides.
Cb is a callback that receives the Event AJO.this object for chaininggetOnHiding ()
Returns the EventHandler registered for the onHiding event.
An AJO around the EventHandler, or null when unset.onHidingProperty ()
Returns the property holding the onHiding EventHandler.
An ObjectProperty AJO around the handler.setOnHidden (callback Cb)
Registers the EventHandler invoked just after the popup is hidden.
Cb is a callback that receives the Event AJO.this object for chaininggetOnHidden ()
Returns the EventHandler registered for the onHidden event.
An AJO around the EventHandler, or null when unset.onHiddenProperty ()
Returns the property holding the onHidden EventHandler.
An ObjectProperty AJO around the handler.queryAccessibleAttribute (object Attribute, list Parameters)
Queries an accessible attribute. Most callers pass the AccessibleAttribute enum AJO from aji.getStaticMember.
Attribute is an AJO around javafx.scene.AccessibleAttribute.Parameters is an optional list of parameter values.The attribute value (AJO or primitive depending on the attribute).executeAccessibleAction (object Action, list Parameters)
Executes an accessible action.
Action is an AJO around javafx.scene.AccessibleAction.Parameters is an optional list of parameter values.this object for chaining
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.