TableView Does Not Update ObservableList In Java FX 2.2

If ever this will happen to you, chances are you used a bean class as the object passed to the ObservableList. Hence, any update done will not update your TableView unless it is binded to that bean class.

To do so, replace your data types like long, int, double to use the Property class and instantiate it with SimpleProperty class. For String, use StringProperty and instantiate it with SimpleStringProperty.

Check this sample class:

Your bean class must have a Property method that will return the property class in order for binding to take effect with your TableView and ObservableList. This is so that the values of the individual entity fields can be observed for changes and any update action will take effect.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *