GridBagLayout Versus FormLayout
- Downloading and Installing JGoodies FormLayout
- FormLayout Basics
- Laying Out the Address Book GUI with FormLayout
- FormLayout Versus GridBagLayout
- Conclusion
In the previous articles in this series, I introduced you to GridBagLayout’s classes, demonstrated various constraints combinations, and showed how to build practical layouts with GridBagLayout. Because GridBagLayout may not do everything you need, in the way you need to do it, this article compares GridBagLayout to another popular layout manager: JGoodies FormLayout.
Downloading and Installing JGoodies FormLayout
GridBagLayout’s complexity has led to the creation of alternative layout managers. These layout managers share GridBagLayout’s flexibility while overcoming its complexity. One of these alternative layout managers is FormLayout, the cornerstone of Karsten Lentzsch’s JGoodies Forms library. You can freely download and incorporate this library into your commercial products, provided that you abide by the terms of its BSD open source license.
Download this library by pointing your web browser to and selecting forms-1_0_7.zip from Karsten’s Downloads :: Libraries web page. After downloading and unzipping this distribution file, I recommend that you move the unzipped forms-1.0.7 subdirectory to the root directory on drive c:\, which results in c:\forms-1.0.7 as the home directory for your copy of the Forms library.
The c:\forms-1.0.7 directory contains a forms-1.0.7.jar file. After establishing the home directory, add this JAR file to your CLASSPATH to make FormLayout accessible to your code. Specify the following to add this JAR file to the Windows 98 SE CLASSPATH, for example:
set classpath=%classpath%;c:\forms-1.0.7\forms-1.0.7.jar
If you’re using a different version of Windows, or a non-Windows operating system, study your OS documentation to find out how to set this environment variable.