hello guys i m new to fxml so please ignore my silly question here are few things which i m try for 2 day but got not success
Hi for the first point here is the solution:
You can set your cellSize in the tableView
, then you will be able to use it for row getting heights(I found this the simplest way to get the rows' height).
After that you have to bind the table's prefHeight
to the size of your data like this:
tableView.setFixedCellSize(20);
tableView.prefHeightProperty().bind(Bindings.size(data).multiply(tableView.getFixedCellSize()).add(30));
There is an .add(30)
because you have to add the tableHeaderRow's size, and this is the simplest way, to do a little experimentation and set that value explicitly. If you want the get the exact value, you can do it via .lookup
s to get the TableHeaderRow
then get its height.
I don't really understand your second problem where do you want to display it. You can use the FXMLLoader to load that view and add to it, but if you specify a little bit better where do you exactly want to add(in which .fxml
, and how is linked with the .fxml
that contains the table).