I added default TEST1 and TEST2 as Name Col in TableView but didn\'t display when I run it. Here are two classes and one fxml I used for, can anyone give me some advices reg
The value you passed to the PropertyValueFactory
(rName
) does not match the property defined in your model class Table
by the get and set method names.
Since you passed "rName", the PropertyValueFactory
will first look for a method called rNameProperty()
returning an ObservableValue<String>
. Since none exists, it will look for a method getRName()
returning a String
. Since that doesn't exist either, your have no value to display in the column. (See the Javadocs for a full description.)
Either change the cell value factory:
iName.setCellValueFactory(new PropertyValueFactory<Table, String>("name"));
or change the method names in the Table
class to getRName()
and setRName(...)
.