A CheckBox is unchecked if selected is false and indeterminate is false.
A CheckBox is undefined if indeterminate is true, regardless of the state of selected. A typical rendering would be with a minus or dash, to indicate an undefined or indeterminate state of the CheckBox. This is convenient for constructing tri-state checkbox based trees, for example, where undefined check boxes typically mean "inherit settings from the parent".
The allowIndeterminate variable, if true, allows the user to cycle through the undefined state. If false, the CheckBox is not in the indeterminate state, and the user is allowed to change only the checked state.
Example:
CheckBox cb = new CheckBox("a checkbox");
cb.setSelected(true);
MnemonicParsing is enabled by default for CheckBox.
| Modifier and Type | Field and Description |
|---|---|
| private BooleanProperty | allowIndeterminate
Determines whether the user toggling the CheckBox should cycle through all three states: checked, unchecked, and undefined. |
| private static final String | |
| private BooleanProperty | indeterminate
Determines whether the CheckBox is in the indeterminate state. |
| private static final PseudoClass | |
| private static final PseudoClass | |
| private static final PseudoClass | |
| private BooleanProperty | selected
Indicates whether this CheckBox is checked. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final BooleanProperty | |
| protected Skin | createDefaultSkin()
Overrides javafx. Create a new instance of the default skin for this control. |
| public void | |
| public final BooleanProperty | |
| private void | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public Object | queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
Overrides javafx. This method is called by the assistive technology to request the value for an attribute. |
| public final BooleanProperty | |
| public final void | |
| public final void | |
| public final void |
| allowIndeterminate | back to summary |
|---|---|
| private BooleanProperty allowIndeterminate Determines whether the user toggling the CheckBox should cycle through
all three states: checked, unchecked, and
undefined. If | |
| DEFAULT_STYLE_CLASS | back to summary |
|---|---|
| private static final String DEFAULT_STYLE_CLASS | |
| indeterminate | back to summary |
|---|---|
| private BooleanProperty indeterminate Determines whether the CheckBox is in the indeterminate state. | |
| PSEUDO_CLASS_DETERMINATE | back to summary |
|---|---|
| private static final PseudoClass PSEUDO_CLASS_DETERMINATE | |
| PSEUDO_CLASS_INDETERMINATE | back to summary |
|---|---|
| private static final PseudoClass PSEUDO_CLASS_INDETERMINATE | |
| PSEUDO_CLASS_SELECTED | back to summary |
|---|---|
| private static final PseudoClass PSEUDO_CLASS_SELECTED | |
| selected | back to summary |
|---|---|
| private BooleanProperty selected Indicates whether this CheckBox is checked. | |
| CheckBox | back to summary |
|---|---|
| public CheckBox() Creates a check box with an empty string for its label. | |
| CheckBox | back to summary |
|---|---|
| public CheckBox(String text) Creates a check box with the specified text as its label.
| |
| allowIndeterminateProperty | back to summary |
|---|---|
| public final BooleanProperty allowIndeterminateProperty() | |
| createDefaultSkin | back to summary |
|---|---|
| protected Skin Overrides javafx. Doc from javafx. Create a new instance of the default skin for this control. This is called to create a skin for the control if
no skin is provided via CSS
| |
| fire | back to summary |
|---|---|
| public void fire() Implements abstract javafx. Toggles the state of the
| |
| indeterminateProperty | back to summary |
|---|---|
| public final BooleanProperty indeterminateProperty() | |
| initialize | back to summary |
|---|---|
| private void initialize() | |
| isAllowIndeterminate | back to summary |
|---|---|
| public final boolean isAllowIndeterminate() | |
| isIndeterminate | back to summary |
|---|---|
| public final boolean isIndeterminate() | |
| isSelected | back to summary |
|---|---|
| public final boolean isSelected() | |
| queryAccessibleAttribute | back to summary |
|---|---|
| public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) Overrides javafx. Doc from javafx. This method is called by the assistive technology to request the value for an attribute.
This method is commonly overridden by subclasses to implement
attributes that are required for a specific role.
| |
| selectedProperty | back to summary |
|---|---|
| public final BooleanProperty selectedProperty() | |
| setAllowIndeterminate | back to summary |
|---|---|
| public final void setAllowIndeterminate(boolean value) | |
| setIndeterminate | back to summary |
|---|---|
| public final void setIndeterminate(boolean value) | |
| setSelected | back to summary |
|---|---|
| public final void setSelected(boolean value) | |