How to convert Integer
To ObservableValue<Integer>
in javafx 2.0 and later ?
相关问题
- I get an exception when trying to swap elements in
- JFX scale image up and down to parent
- Dragging an undecorated Stage in JavaFX
- JavaFX sample issue
- How to properly use Weld in JavaFX 2 application?
相关文章
- Low quality icon in taskbar of a Stage. JavaFX
- Loading custom font using JavaFX 8 and css
- Javafx Platform.runLater never running
- JavaFX scrolling table update performance degrades
- How to change the color of pane in javafx?
- Javafx select multiple rows
- TableView has more columns than specified
- Escape from a Number TextField in a JavaFX dialog
Another way.
IntegerProperty
implementsObservableValue<Number>
notObservableValue<Integer>
. So you should do:We use a
ReadOnlyObjectWrapper<>(*integer value*);
and store the value in aObservableValue<Integer>
reference.Update
Starting JavaFX 8, you can also do the following :