Setting tableview type to general type from FXML?

TableViewThe JavaFX 2.2 class has a generic type S, I'm wondering how can I install this from FXML?

+5
source share
3 answers

The same thing happens with ListView or ComboBox. But I think in the FXML file you define controls and you define a generic ListView or ComboBox or TableView or something else. No matter what they are going to show.

So, for me, it makes more sense to set the generic type in the JavaFX controller class, rather than in the FXML file.

Hope this helps.

+4
source

FXML . , . .

+3

I usually agree with the answers here, but when you use Scene Builder to develop your GUIs and then want to import parts of the skeleton controller into your code for the updates you made, it is really annoying to remember to come back and replace everything [?] And [?,?] with the names of real classes. It would be nice if either the FXML specification or Scene Builder allowed you to specify template classes.

0
source

All Articles