How can I automatically adjust a TableColumn in JavaFX to the size of the TableView?
I have a table which only contains the columns ID and Name. However, this table is embedded in a SplitPane to give the user the opportunity to change the size easily and quickly. I want that the table is always filled in the whole width. The size of the ID column is set to 70 and only the Name column should always propagate to the remaining width of the table. I use FXML to create my layout. Is there a possibility to set this directly in the FXML?
OK, try with a following:
idcolumn.prefWidthProperty().bind(table.widthProperty().multiply(0.15)); namecolumn.prefWidthProperty().bind(table.widthProperty().multiply(0.85));
assuming that table is a width of SplitPane.