WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.
One of my coworkers sent this link to me:
http://madbean.com/blog/2004/17/totallygridbag.html. I found it hilarious; if you've written Swing code by hand you probably will too.
I don't want to start a flamewar here, but I really like the grid bag layout: it's the only way I can
- get components to line up the way I want them, and
- have them move and scale correctly for resizing, and
- be able to tweak component distances
(12 pixels on the left, 11 on the right...)
Of course, I don't do what the animation shows: typing in source code to manipulate the layout directly. This is a perfect occasion for a tool. With NetBeans it's a breeze customizing gridbag layouts using their gridbag layout customizer. Experimenting with it is how I learned how the gridbag layout works, but even now that I know I prefer to use a tool to create layout code.