I am using JavaFx 2.0 and Java 7. The question is regarding Table View in JavaFX.
The below sample code creates a firstName column and assigns cell factory and cell
You can also just modify the getter method of your data object. In your case this is the class Person, which holds firstName, lastName and (presumably) prefix.
Add a new method to the Person class:
public String getTotalName() {
return this.prefix + " " + this.getLastName() + ", " + this.getFirstName();
}
and then just apply the CellValueFactory:
totalNameCol.setCellValueFactory(
new PropertyValueFactory("totalName")
);
I find this more comfortable and than using callbacks.