This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
GridBagLayout is painful to learn and to use. Sorry to hear you're having difficult with it. I've modified you're code below to display the form a little better. I'm having difficult figuring out what you're trying to accomplish, but this looks better and the fields are better aligned.
I'd suggest looking into using another layout manager. For example, using ZoneLayout (http://www.zonelayout.com), your layout code would look like:
I might suggest that you take a look at the JGoodies forms layout library. Karsten has included a very helpful whitepaper that explains how to use the forms layout manager. I've found that it's very easy to use.
Even though this does not answer your question about GridBagLayout your code is break sytle crime, which would piss off any employer or instructor/professor or whoever you are turing it into so read this guide Bleeding at the Keyboard
Jerret Halter<br /> <br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.<hr></blockquote>
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com