0

I have know how to create FXML file that describes a table. Meanwhile, according to Oracle Tutorial, it is a best practice to implement a class that defines the data model and provides methods and fields to further work with the table.

However, It's rather cumbersome and time consuming to typing the code. So, is there any tools that can generate the java code of a table's data model by parsing it's FXML describe file?

Regards, Qinn

Qinn
  • 31
  • 1
  • 4

1 Answers1

0

I don't know about any java generateion from FXML, although it wouldn't be so hard to build. Instead, have you tried the PropertyValueFactory class? You can set it on a TableColumn's cellValueFactory and give it the string name of a getter in your object. It only takes a line of code to setup, might be easier?

See http://docs.oracle.com/javafx/2/api/javafx/scene/control/cell/PropertyValueFactory.html

Andy Till
  • 3,371
  • 2
  • 18
  • 23