FXML set TableView column resize policy
10,555
To set columnresize policy for tableview using fxml , you have to use <columnResizePolicy>
tag . This will work on javafx 2.2 and later..
<TableView>
<columnResizePolicy><TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/></columnResizePolicy>
</TableView>
Reference :
Defining TableView columnResizePolicy property with fxml
Author by
Lakatos Gyula
Updated on June 14, 2022Comments
-
Lakatos Gyula almost 2 years
How can I set a TableView's resize policy from FXML? I tired this way, but it's not working:
<TableView layoutX="20.0" layoutY="20.0" prefWidth="674.0" prefHeight="668.0" fx:id="tableView" fx:constant="CONSTRAINED_RESIZE_POLICY"> <columns> <TableColumn text="First Name" /> <TableColumn text="Last Name" /> <TableColumn text="Email Address" /> </columns> </TableView>