I was wondering if in JavaFX, binding can be an alternative to action listener/events ? Can we handle all actions with binding instead of event handling ?
相关问题
- JFX scale image up and down to parent
- How to properly use Weld in JavaFX 2 application?
- JavaFX, MediaPlayer - volume trouble! Why the volu
- What the easiest way to animate a Path as an objec
- JavaFX 2 ComboBox setValue() does not set CB text
相关文章
- Loading custom font using JavaFX 8 and css
- JavaFX scrolling table update performance degrades
- How to change the color of pane in javafx?
- TableView has more columns than specified
- How to merge cells in JavaFX Scene builder?
- Can you specify minor jdk version for travis ci
- JavaFX: Tested/confirmed hardware (GPU) accelerati
- How to work with canvas and text in javafx
No, binding is not an alternative to event handlers.
You could bind event properties to different event handlers, but then you would be using both technologies, not one or the other.
Generally you use binding for synchronizing data values and event handlers for running code on some event.
As an alternative to a bind call to set the value of dependent property, you can use change listeners to react on a change and trigger arbitrary code which could set the value of a dependent property. A change listener is different from an event handler. Change listeners and invalidation listeners can be used as an alternative to a binding but not vice versa in a general case.