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 Matthew and Pavel: Gridbaglayout? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Matthew and Pavel: Gridbaglayout?" Watch "Matthew and Pavel: Gridbaglayout?" New topic

Matthew and Pavel: Gridbaglayout?

Rick Portugal
Ranch Hand

Joined: Dec 17, 2002
Posts: 243
Half of the people I know who use Swing say that GridBagLayout is indespensible and they use it often. The other half think it is too complex and should be avoided like the plague.
Where do you stand on that?

Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
I am with the first group.
Sudha Lakshman

Joined: Nov 26, 2001
Posts: 17
Me too... first group.... it might seem a little tough in the beginning.. but later it gets better....
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2591

However, BoxLayout and Box will solve most of your problems; besides it's flexible and at the same time not complex. Works for me in most cases.
As for GBL, if you get things on paper, it's not too complex to key in those things.
- Manish
Matt Robinson

Joined: Apr 30, 2001
Posts: 16
I'd say we're both in the second camp; it really seems to comes down to a matter of taste and what works best for you

Matthew Robinson
co-author of Swing Second Edition (2003, Manning Publications).
Mohan Panigrahi
Ranch Hand

Joined: Sep 28, 2001
Posts: 142
You can use table layout. It is a significant improvement over grid bag layout.
You can freely download tablelayout.jar
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
I am with the first group. I don't think GridBagLayout is complex. I had a fast look at TableLayout and I couldn't make out any advantage over GridBagLayout. Actually, I think GBL is quite straight forward, but the API documentation is a pain. you have to do trial/error to find out what the constraints are for.
[ April 03, 2003: Message edited by: Chantal Ackermann ]
Richard Teston
Ranch Hand

Joined: Feb 12, 2002
Posts: 89
I wrote a very extensive Swing applet application for one year and I say I'm one of those GridBagLayout Federation user. I started first using VisaJ for creating GUI done some trial and error then i figured out how the GridBagConstraints works, yeah its very complex and confusing at the first time but when you get the hang of it you can code GUI with your eyes closed.

The Code is the Programmer
I agree. Here's the link:
subject: Matthew and Pavel: Gridbaglayout?
It's not a secret anymore!