0

I've made a simple GUI with 2 lines of checkboxes. The checkboxes are all the same size. When I maximize the application, they are anchored on the left so it looks a bit out of place.

I would like to have the checkboxes slowly move to the first line if there is space. Similar to the way 'float' works in CSS (on websites).

Does Swing have this type of functionality?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Terence Chow
  • 10,755
  • 24
  • 78
  • 141

2 Answers2

2

Similar to the way 'float' works in CSS (on websites).

Look to FlowLayout for that effect.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
2

Check out Wrap Layout which works in many cases.

camickr
  • 321,443
  • 19
  • 166
  • 288