I'm trying to show a HBox which contains a list of checkboxes. Example:
HBox container = new HBox();
for (Weekday day: Weekday.values() )
{
container.getChildren().add( new CheckBox( day.getName() ) );
}
However this shows the days all on one line, as:
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
The window is not big enough to show them all on one line, and so I get a horizontal scrollbar. What I need is to show the days on two lines, e.g:
Sunday Monday Tuesday Wednesday
Thursday Friday Saturday
I've tried container.setPrefWidth()
but it just causes it to show Su.., Mo..
to truncate the text rather than moving them to the next line.