Class ChoiceBox<T>
- All Implemented Interfaces:
LayoutMeasurable
,LayoutMeasurableMixin
,HasBackgroundProperty
,HasBlendModeProperty
,HasBorderProperty
,HasClipProperty
,HasEffectProperty
,HasHeightProperty
,HasLayoutXProperty
,HasLayoutYProperty
,HasManagedProperty
,HasMaxHeightProperty
,HasMaxWidthProperty
,HasMinHeightProperty
,HasMinWidthProperty
,HasMouseTransparentProperty
,HasOnMouseClickedProperty
,HasOpacityProperty
,HasPaddingProperty
,HasParentProperty
,HasPrefHeightProperty
,HasPrefWidthProperty
,HasSnapToPixelProperty
,HasVisibleProperty
,HasWidthProperty
,Styleable
,EventTarget
,Skinnable
,INode
,PreferenceResizableNode
By default, the ChoiceBox has no item selected unless otherwise specified. Although the ChoiceBox will only allow a user to select from the predefined list, it is possible for the developer to specify the selected item to be something other than what is available in the predefined list. This is required for several important use cases.
It means configuration of the ChoiceBox is order independent. You may either specify the items and then the selected item, or you may specify the selected item and then the items. Either way will function correctly.
ChoiceBox item selection is handled by
SelectionModel
As with ListView and ComboBox, it is possible to modify the
SelectionModel
that is used,
although this is likely to be rarely changed. ChoiceBox supports only a
single selection model, hence the default used is a SingleSelectionModel
.
import javafx.scene.control.ChoiceBox; ChoiceBox cb = new ChoiceBox(); cb.getItems().addAll("item1", "item2", "item3");
- Since:
- JavaFX 2.0
-
Property Summary
TypePropertyDescriptionAllows a way to specify how to represent objects in the items list.final ObjectProperty<ObservableList<T>>
The items to display in the choice box.final ObjectProperty<EventHandler<ActionEvent>>
The ChoiceBox action, which is invoked whenever the ChoiceBoxvalue
property is changed.final ObjectProperty<EventHandler<Event>>
Called just after theChoiceBox
popup has been hidden.final ObjectProperty<EventHandler<Event>>
Called just prior to theChoiceBox
popup being hidden.final ObjectProperty<EventHandler<Event>>
Called just prior to theChoiceBox
popup being shown.final ObjectProperty<EventHandler<Event>>
Called just after theChoiceBox
popup is shown.final ObjectProperty<SingleSelectionModel<T>>
The selection model for the ChoiceBox.Indicates whether the drop down is displaying the list of choices to the user.The value of this ChoiceBox is defined as the selected item in the ChoiceBox selection model.Properties inherited from class javafx.scene.control.Control
contextMenu, skin
Properties inherited from class javafx.scene.layout.Region
background, border, height, insets, maxHeight, maxWidth, minHeight, minWidth, padding, prefHeight, prefWidth, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
blendMode, cacheHint, cache, clip, cursor, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, layoutBounds, layoutX, layoutY, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onScroll, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, opacity, parent, pressed, rotate, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, visible
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendMode
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clip
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effect
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
layoutX
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
layoutY
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
managed
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
mouseTransparent
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
onMouseClicked
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
opacity
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
parent
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
visible
-
Field Summary
Modifier and TypeFieldDescriptionCalled when the ChoiceBox popup has been hidden.Called when the ChoiceBox popup will be hidden.Called prior to the ChoiceBox showing its popup after the user has clicked or otherwise interacted with the ChoiceBox.Called after the ChoiceBox has shown its popup.Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHT
Fields inherited from interface javafx.scene.layout.PreferenceResizableNode
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Constructor Summary
ConstructorDescriptionCreate a new ChoiceBox which has an empty list of items.ChoiceBox
(ObservableList<T> items) Create a new ChoiceBox with the given set of items. -
Method Summary
Modifier and TypeMethodDescriptionAllows a way to specify how to represent objects in the items list.final StringConverter<T>
Gets the value of theconverter
property.final ObservableList<T>
getItems()
Gets the value of theitems
property.final EventHandler<ActionEvent>
Gets the value of theonAction
property.final EventHandler<Event>
Gets the value of theonHidden
property.final EventHandler<Event>
Gets the value of theonHiding
property.final EventHandler<Event>
Gets the value of theonShowing
property.final EventHandler<Event>
Gets the value of theonShown
property.final SingleSelectionModel<T>
Gets the value of theselectionModel
property.final T
getValue()
Gets the value of thevalue
property.void
hide()
Closes the list of choices.final boolean
final ObjectProperty<ObservableList<T>>
The items to display in the choice box.final ObjectProperty<EventHandler<ActionEvent>>
The ChoiceBox action, which is invoked whenever the ChoiceBoxvalue
property is changed.final ObjectProperty<EventHandler<Event>>
Called just after theChoiceBox
popup has been hidden.final ObjectProperty<EventHandler<Event>>
Called just prior to theChoiceBox
popup being hidden.final ObjectProperty<EventHandler<Event>>
Called just prior to theChoiceBox
popup being shown.final ObjectProperty<EventHandler<Event>>
Called just after theChoiceBox
popup is shown.final ObjectProperty<SingleSelectionModel<T>>
The selection model for the ChoiceBox.final void
setConverter
(StringConverter<T> value) Sets the value of theconverter
property.final void
setItems
(ObservableList<T> value) Sets the value of theitems
property.final void
setOnAction
(EventHandler<ActionEvent> value) Sets the value of theonAction
property.final void
setOnHidden
(EventHandler<Event> value) Sets the value of theonHidden
property.final void
setOnHiding
(EventHandler<Event> value) Sets the value of theonHiding
property.final void
setOnShowing
(EventHandler<Event> value) Sets the value of theonShowing
property.final void
setOnShown
(EventHandler<Event> value) Sets the value of theonShown
property.final void
setSelectionModel
(SingleSelectionModel<T> value) Sets the value of theselectionModel
property.final void
Sets the value of thevalue
property.void
show()
Opens the list of choices.Indicates whether the drop down is displaying the list of choices to the user.The value of this ChoiceBox is defined as the selected item in the ChoiceBox selection model.Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, getBaselineOffset, getContextMenu, getSkin, layoutChildren, setContextMenu, setSkin, shouldUseLayoutMeasurable, skinProperty
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, boundedSize, getInsets, heightProperty, impl_computeGeomBounds, impl_computeLayoutBounds, impl_maxHeight, impl_maxWidth, impl_minHeight, impl_minWidth, impl_prefHeight, impl_prefWidth, insetsProperty, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, paddingProperty, positionInArea, positionInArea, prefHeightProperty, prefWidthProperty, resize, setMaxSize, setMinSize, setPrefSize, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, needsLayoutProperty, requestLayout, requestParentLayout, setLayoutFlag, setNeedsLayout, setSceneRoot
Methods inherited from class javafx.scene.Node
addEventFilter, addEventHandler, autosize, blendModeProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, createLayoutMeasurable, cursorProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAllNodeTransforms, getBoundsInLocal, getCacheHint, getCursor, getEventDispatcher, getId, getLayoutMeasurable, getNodePeer, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOrCreateAndBindNodePeer, getProperties, getRotate, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getUserData, hasProperties, hoverProperty, idProperty, impl_getLayoutBounds, impl_isTreeVisible, impl_traverse, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isPressed, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScreen, localToScreen, localToScreen, localToScreen, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onNodePeerReady, onPeerSizeChanged, onScrollProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, opacityProperty, parentProperty, parentToLocal, pressedProperty, removeEventFilter, removeEventHandler, requestFocus, requestPeerFocus, rotateProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setCache, setCacheHint, setCursor, setDisable, setDisabled, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setNodePeer, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setPressed, setRotate, setScaleX, setScaleY, setScaleZ, setScene, setStyle, setTranslateX, setTranslateY, setUserData, snapshot, startDragAndDrop, styleProperty, toBack, toFront, translateXProperty, translateYProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBackgroundProperty
getBackground, setBackground
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendModeProperty, getBlendMode, setBlendMode
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBorderProperty
getBorder, setBorder
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clipProperty, getClip, setClip
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effectProperty, getEffect, setEffect
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasHeightProperty
getHeight, setHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, layoutXProperty, setLayoutX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, layoutYProperty, setLayoutY
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, managedProperty, setManaged
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxHeightProperty
getMaxHeight, setMaxHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxWidthProperty
getMaxWidth, setMaxWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinHeightProperty
getMinHeight, setMinHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinWidthProperty
getMinWidth, setMinWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, mouseTransparentProperty, setMouseTransparent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, onMouseClickedProperty, setOnMouseClicked
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, opacityProperty, setOpacity
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPaddingProperty
getPadding, setPadding
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, parentProperty, setParent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefHeightProperty
getPrefHeight, setPrefHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefWidthProperty
getPrefWidth, setPrefWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSnapToPixelProperty
isSnapToPixel, setSnapToPixel
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible, visibleProperty
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasWidthProperty
getWidth, setWidth
Methods inherited from interface javafx.scene.INode
autosize, getAllNodeTransforms, getContentBias, getNodePeer, getOrCreateAndBindNodePeer, getProperties, getScene, getTransforms, hasProperties, relocate, resizeRelocate
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, getLayoutMeasurable, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
Methods inherited from interface javafx.scene.layout.PreferenceResizableNode
isResizable
-
Property Details
-
selectionModel
The selection model for the ChoiceBox. Only a single choice can be made, hence, the ChoiceBox supports only a SingleSelectionModel. Generally, the main interaction with the selection model is to explicitly set which item in the items list should be selected, or to listen to changes in the selection to know which item has been chosen. -
showing
Indicates whether the drop down is displaying the list of choices to the user. This is a readonly property which should be manipulated by means of the #show and #hide methods.- See Also:
-
items
The items to display in the choice box. The selected item (as indicated in the selection model) must always be one of these items. -
converter
Allows a way to specify how to represent objects in the items list. When a StringConverter is set, the object toString method is not called and instead its toString(object T) is called, passing the objects in the items list. This is useful when using domain objects in a ChoiceBox as this property allows for customization of the representation. Also, any of the pre-built Converters available in theinvalid @link
javafx.util.converter
- Since:
- JavaFX 2.1
- See Also:
-
value
The value of this ChoiceBox is defined as the selected item in the ChoiceBox selection model. The valueProperty is synchronized with the selectedItem. This property allows for bi-directional binding of external properties to the ChoiceBox and updates the selection model accordingly.- Since:
- JavaFX 2.1
- See Also:
-
onAction
The ChoiceBox action, which is invoked whenever the ChoiceBoxvalue
property is changed. This may be due to the value property being programmatically changed or when the user selects an item in a popup menu.- Since:
- JavaFX 8u60
- See Also:
-
onShowing
Called just prior to theChoiceBox
popup being shown.- Since:
- JavaFX 8u60
- See Also:
-
onShown
Called just after theChoiceBox
popup is shown.- Since:
- JavaFX 8u60
- See Also:
-
onHiding
Called just prior to theChoiceBox
popup being hidden.- Since:
- JavaFX 8u60
- See Also:
-
onHidden
Called just after theChoiceBox
popup has been hidden.- Since:
- JavaFX 8u60
- See Also:
-
-
Field Details
-
ON_SHOWING
Called prior to the ChoiceBox showing its popup after the user has clicked or otherwise interacted with the ChoiceBox.- Since:
- JavaFX 8u60
-
ON_SHOWN
Called after the ChoiceBox has shown its popup.- Since:
- JavaFX 8u60
-
ON_HIDING
Called when the ChoiceBox popup will be hidden.- Since:
- JavaFX 8u60
-
ON_HIDDEN
Called when the ChoiceBox popup has been hidden.- Since:
- JavaFX 8u60
-
-
Constructor Details
-
ChoiceBox
public ChoiceBox()Create a new ChoiceBox which has an empty list of items. -
ChoiceBox
Create a new ChoiceBox with the given set of items. Since it is observable, the content of this list may change over time and the ChoiceBox will be updated accordingly.- Parameters:
items
-
-
-
Method Details
-
setSelectionModel
Sets the value of theselectionModel
property.- Property description:
- The selection model for the ChoiceBox. Only a single choice can be made, hence, the ChoiceBox supports only a SingleSelectionModel. Generally, the main interaction with the selection model is to explicitly set which item in the items list should be selected, or to listen to changes in the selection to know which item has been chosen.
- Parameters:
value
- the value for theselectionModel
property- See Also:
-
getSelectionModel
Gets the value of theselectionModel
property.- Property description:
- The selection model for the ChoiceBox. Only a single choice can be made, hence, the ChoiceBox supports only a SingleSelectionModel. Generally, the main interaction with the selection model is to explicitly set which item in the items list should be selected, or to listen to changes in the selection to know which item has been chosen.
- Returns:
- the value of the
selectionModel
property - See Also:
-
selectionModelProperty
The selection model for the ChoiceBox. Only a single choice can be made, hence, the ChoiceBox supports only a SingleSelectionModel. Generally, the main interaction with the selection model is to explicitly set which item in the items list should be selected, or to listen to changes in the selection to know which item has been chosen.- Returns:
- the
selectionModel
property - See Also:
-
isShowing
public final boolean isShowing() -
showingProperty
Indicates whether the drop down is displaying the list of choices to the user. This is a readonly property which should be manipulated by means of the #show and #hide methods.- Returns:
- the
showing
property
-
setItems
Sets the value of theitems
property.- Property description:
- The items to display in the choice box. The selected item (as indicated in the selection model) must always be one of these items.
- Parameters:
value
- the value for theitems
property- See Also:
-
getItems
Gets the value of theitems
property.- Property description:
- The items to display in the choice box. The selected item (as indicated in the selection model) must always be one of these items.
- Returns:
- the value of the
items
property - See Also:
-
itemsProperty
The items to display in the choice box. The selected item (as indicated in the selection model) must always be one of these items.- Returns:
- the
items
property - See Also:
-
converterProperty
Allows a way to specify how to represent objects in the items list. When a StringConverter is set, the object toString method is not called and instead its toString(object T) is called, passing the objects in the items list. This is useful when using domain objects in a ChoiceBox as this property allows for customization of the representation. Also, any of the pre-built Converters available in theinvalid @link
javafx.util.converter
- Returns:
- the
converter
property - Since:
- JavaFX 2.1
- See Also:
-
setConverter
Sets the value of theconverter
property.- Property description:
- Allows a way to specify how to represent objects in the items list. When
a StringConverter is set, the object toString method is not called and
instead its toString(object T) is called, passing the objects in the items list.
This is useful when using domain objects in a ChoiceBox as this property
allows for customization of the representation. Also, any of the pre-built
Converters available in the
invalid @link
javafx.util.converter
- Parameters:
value
- the value for theconverter
property- Since:
- JavaFX 2.1
- See Also:
-
getConverter
Gets the value of theconverter
property.- Property description:
- Allows a way to specify how to represent objects in the items list. When
a StringConverter is set, the object toString method is not called and
instead its toString(object T) is called, passing the objects in the items list.
This is useful when using domain objects in a ChoiceBox as this property
allows for customization of the representation. Also, any of the pre-built
Converters available in the
invalid @link
javafx.util.converter
- Returns:
- the value of the
converter
property - Since:
- JavaFX 2.1
- See Also:
-
valueProperty
The value of this ChoiceBox is defined as the selected item in the ChoiceBox selection model. The valueProperty is synchronized with the selectedItem. This property allows for bi-directional binding of external properties to the ChoiceBox and updates the selection model accordingly.- Returns:
- the
value
property - Since:
- JavaFX 2.1
- See Also:
-
setValue
Sets the value of thevalue
property.- Property description:
- The value of this ChoiceBox is defined as the selected item in the ChoiceBox selection model. The valueProperty is synchronized with the selectedItem. This property allows for bi-directional binding of external properties to the ChoiceBox and updates the selection model accordingly.
- Parameters:
value
- the value for thevalue
property- Since:
- JavaFX 2.1
- See Also:
-
getValue
Gets the value of thevalue
property.- Property description:
- The value of this ChoiceBox is defined as the selected item in the ChoiceBox selection model. The valueProperty is synchronized with the selectedItem. This property allows for bi-directional binding of external properties to the ChoiceBox and updates the selection model accordingly.
- Returns:
- the value of the
value
property - Since:
- JavaFX 2.1
- See Also:
-
onActionProperty
The ChoiceBox action, which is invoked whenever the ChoiceBoxvalue
property is changed. This may be due to the value property being programmatically changed or when the user selects an item in a popup menu.- Returns:
- the
onAction
property - Since:
- JavaFX 8u60
- See Also:
-
setOnAction
Sets the value of theonAction
property.- Property description:
- The ChoiceBox action, which is invoked whenever the ChoiceBox
value
property is changed. This may be due to the value property being programmatically changed or when the user selects an item in a popup menu. - Parameters:
value
- the value for theonAction
property- Since:
- JavaFX 8u60
- See Also:
-
getOnAction
Gets the value of theonAction
property.- Property description:
- The ChoiceBox action, which is invoked whenever the ChoiceBox
value
property is changed. This may be due to the value property being programmatically changed or when the user selects an item in a popup menu. - Returns:
- the value of the
onAction
property - Since:
- JavaFX 8u60
- See Also:
-
onShowingProperty
Called just prior to theChoiceBox
popup being shown.- Returns:
- the
onShowing
property - Since:
- JavaFX 8u60
- See Also:
-
setOnShowing
Sets the value of theonShowing
property.- Property description:
- Called just prior to the
ChoiceBox
popup being shown. - Parameters:
value
- the value for theonShowing
property- Since:
- JavaFX 8u60
- See Also:
-
getOnShowing
Gets the value of theonShowing
property.- Property description:
- Called just prior to the
ChoiceBox
popup being shown. - Returns:
- the value of the
onShowing
property - Since:
- JavaFX 8u60
- See Also:
-
onShownProperty
Called just after theChoiceBox
popup is shown.- Returns:
- the
onShown
property - Since:
- JavaFX 8u60
- See Also:
-
setOnShown
Sets the value of theonShown
property.- Property description:
- Called just after the
ChoiceBox
popup is shown. - Parameters:
value
- the value for theonShown
property- Since:
- JavaFX 8u60
- See Also:
-
getOnShown
Gets the value of theonShown
property.- Property description:
- Called just after the
ChoiceBox
popup is shown. - Returns:
- the value of the
onShown
property - Since:
- JavaFX 8u60
- See Also:
-
onHidingProperty
Called just prior to theChoiceBox
popup being hidden.- Returns:
- the
onHiding
property - Since:
- JavaFX 8u60
- See Also:
-
setOnHiding
Sets the value of theonHiding
property.- Property description:
- Called just prior to the
ChoiceBox
popup being hidden. - Parameters:
value
- the value for theonHiding
property- Since:
- JavaFX 8u60
- See Also:
-
getOnHiding
Gets the value of theonHiding
property.- Property description:
- Called just prior to the
ChoiceBox
popup being hidden. - Returns:
- the value of the
onHiding
property - Since:
- JavaFX 8u60
- See Also:
-
onHiddenProperty
Called just after theChoiceBox
popup has been hidden.- Returns:
- the
onHidden
property - Since:
- JavaFX 8u60
- See Also:
-
setOnHidden
Sets the value of theonHidden
property.- Property description:
- Called just after the
ChoiceBox
popup has been hidden. - Parameters:
value
- the value for theonHidden
property- Since:
- JavaFX 8u60
- See Also:
-
getOnHidden
Gets the value of theonHidden
property.- Property description:
- Called just after the
ChoiceBox
popup has been hidden. - Returns:
- the value of the
onHidden
property - Since:
- JavaFX 8u60
- See Also:
-
show
public void show()Opens the list of choices. -
hide
public void hide()Closes the list of choices.
-