Of the following "click to act" UI elements
- Button (and variants, Toggle, Menu, etc.)
- CheckBox
- ChoiceBox
- ColorPicker
- ComboBox
- HyperLink
- RadioButton
only ChoiceBox does not have an "onAction" method. All others do, and the method is supported in Scene Builder. (I suspect someone can quibble with "click to act" in a touch world, but let's not get hung up on a phrase.)
Unless I'm missing something, ChoiceBox is missing an "onAction" method.
Yes, the developer can dig deeply into implementation details and pull this rabbit out of the API hat:
choiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener....);
but why is this necessary only for ChoiceBox?
- Button (and variants, Toggle, Menu, etc.)
- CheckBox
- ChoiceBox
- ColorPicker
- ComboBox
- HyperLink
- RadioButton
only ChoiceBox does not have an "onAction" method. All others do, and the method is supported in Scene Builder. (I suspect someone can quibble with "click to act" in a touch world, but let's not get hung up on a phrase.)
Unless I'm missing something, ChoiceBox is missing an "onAction" method.
Yes, the developer can dig deeply into implementation details and pull this rabbit out of the API hat:
choiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener....);
but why is this necessary only for ChoiceBox?