permaculture playing cards*
The moose likes Swing / AWT / SWT and the fly likes best layout to use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "best layout to use" Watch "best layout to use" New topic

best layout to use

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 246

i would like to have in a jpanel:

jlabel - jtextfield
jlabel - jtextfield
jlabel - jtextarea

i don't want to allow to resize component in height

what layout do you suggest me?

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
because of the textArea (presumably in a scrollpane), nested borderlayout panels
in a BoxLayout (y-axis) panel might work.

but it might be a good exercise to try and get a GridBagLayout to work
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10175

You can also google for MigLayout.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rob Spoor

Joined: Oct 27, 2005
Posts: 19656

Although I would use JGoodies' FormLayout, I think GroupLayout might work here just fine.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: best layout to use
Similar Threads
Trouble with GridLayout, BoxLayout .... any sort of layout!
BoxLayout not working as advertised?
creating custom JComponent
Trying to convert jtextfields to a double
JTextArea scroll bar