JavaFx TableView Columns don't fill the TableView Width

左心房为你撑大大i 提交于 2019-12-10 16:37:00

问题


I have a TableView generated with SceneBuilder and all the columns are FXML imports from other views, until there no problem, but the columns don't fill the width.

I tried to fix this with scene builder and FXML, but no luck, all the sizes are computed.

I tried to code it with a change listener that checks every time the window changes size to adapt the size of the columns.

This works and the columns resize to the proper width (basically I am getting the table view width and divide it by the number of columns), but for some reason the point where the column starts doesn't change and they overlap with each other.

Any suggestions?


回答1:


Select the TableView in Scenebuilder an go to the Properties an change "Colum Resize P..." to the value > "constrained-resize":

Normally thats all you need.

If that doesn't work, you can try to reset the columns values:

  • Select all columns you have at the same time
  • Go to Layout and change all setting to the settings in the picture

This should work.



来源:https://stackoverflow.com/questions/44294622/javafx-tableview-columns-dont-fill-the-tableview-width

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!