mercredi 14 janvier 2015

is there a grid layout in javafx that wraps?

I was trying to search for the answer to my question but I am not really even sure what to google for to find the answer - so here I am on stackoverflow.


In my app I am using java 1.8 with javafx for the GUI. I want to add N number of checkboxes onto a stage and each checkbox has a label on it. The labels can be any number of characters in length. The checkboxes will be added by the user as my application runs. I want to allow more than 1 checkbox on each row. So basically I want to have a table or grid layout so all the checkboxes are aligned in a grid. It should fill in the first row and once all horizontal space is taken up it should start a new row.


Now lets say the first row has 8 checkboxes and then the second row starts to get filled in. If something on row 2 has a really long label maybe only 6 checkboxes will fit on the second row. I cant have 8 columns in the first row and 6 columns in the second row and still have everything aligned. So now I have to change the number of columns in the grid to 6 (moving 2 checkboxes from the first row into the second row) and re-layout everything.


Is there any layout or control that handles this? FYI - I don't want to allow horizontal scrollbars.





Aucun commentaire:

Enregistrer un commentaire