File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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: 250

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: 10266

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: 19672

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