0

So, I'm totally new to LayoutManager. I've already read about the existing LayoutManager but don't which the best is to get a Layout like this. The different colorboxes represent JPanels.

enter image description here

Which one should I use?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
ColdStormy
  • 562
  • 1
  • 6
  • 15

3 Answers3

1

You can use FormLayout from JGoodies.

Toilal
  • 3,301
  • 1
  • 24
  • 32
1

That layout might be achieved using a GroupLayout with two vertical groups and two horizontal groups.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 1
    @kleopatra During creation of a ['two column layout'](http://stackoverflow.com/a/16353404/418556) factory method for groups of labels (column 1) and controls (column 2) I realized why people say GL is designed for IDE (i.e. GUI designer) use. After a lot of work I got a result that was satisfying, but attempts to tweak that slightly to include a bottom row of buttons was utterly *unsuccessful.* Having said that. A) My statement is merely a statement of fact. B) The OP *might* be using a GUI designer, in which case it would only take a 'few moments' to create using this J2SE layout. ;) – Andrew Thompson Jun 15 '13 at 10:46
0

See How to Use GridBagLayout.

  1. Red is displayed at its preferred size.
  2. Blue is filled horizontally
  3. Green is filled vertically
  4. Cyan is filled vertically and horizontally.
camickr
  • 321,443
  • 19
  • 166
  • 288