child fxml file not loading to parent fxml

后端 未结 1 2076
时光取名叫无心
时光取名叫无心 2021-01-29 05:47

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

  1. remove white space from table i.e ta
1条回答
  •  粉色の甜心
    2021-01-29 06:21

    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 .lookups 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).

    0 讨论(0)
提交回复
热议问题