Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFx TableView Columns don't fill the TableView Width

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?

like image 719
Ocirederf Avatar asked May 31 '17 21:05

Ocirederf


1 Answers

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

enter image description here

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 enter image description here

This should work.

like image 145
Developer66 Avatar answered Nov 11 '22 23:11

Developer66