Reverting Swing Application to Java SE 1.5
Got bored with running my home-grown bookmarker application in a Windows virtual machine on my Mac: decided to regress from Java SE 6 to JDK1.5 so it would run directly on the Mac between now and October's Leopard release. :-(
Moved the NetBeans project files across, opened the project in NetBeans, and, of course, had lots of errors, mostly due to the references to GroupLayout stuff that had been generated by the NetBeans Matisse capability. So how do I get nb to regenerate the code for the layout to use the swing-layout library?
Turns out to be easy … once you know how. For each form, with the Inspector, choose Properties, then change the Layout Generation Style from "Standard Java 6 code" to "Swing Layout Extensions Library". Clean and build, and you're done.
Trackback URL: http://blogs.sun.com/coldrick/entry/reverting_swing_application_to_java
Post a Comment:

Posted by Shai Almog on July 11, 2007 at 03:46 AM EST #
Posted by 61.246.161.66 on July 11, 2007 at 02:52 PM EST #
Posted by Stodge on July 11, 2007 at 10:44 PM EST #
Posted by Stodge on July 12, 2007 at 10:25 AM EST #
So you need to be in the Design tab for the form (not the source), then you need to click on "Form whatever-your-form-is-called" in the Inspector window (by default, on the left at the bottom). The properties window should be as shown in the link
Posted by David Coldrick on July 12, 2007 at 11:25 AM EST #
Posted by Stodge on July 13, 2007 at 11:01 AM EST #
Posted by mahdy on August 04, 2007 at 06:05 PM EST #
Posted by ANDREW MCNEILL on August 06, 2007 at 01:17 PM EST #
Posted by David Coldrick on August 06, 2007 at 01:29 PM EST #
Anyone know of a way to regenerate the .java file for a form from the .form file? The IDE crashed on me, and when I restarted, the .java file was blank, but the .form file is still intact.
TIA,
J.D.
Posted by J.D. on August 28, 2007 at 07:15 AM EST #
Soryy, JD, don't know of a way
Posted by David Coldrick on August 28, 2007 at 10:38 AM EST #
JD found an answer elsewhere that's worth posting:
1. move your .form file to a safe place.
2. create a new, blank form with the same name as the original. This
creates a new .form file and a new .java file with the required codegen
tags.
3. copy the original .form file over the newly created one.
4. touch the .form file, to update its date to after the java file was
created.
5. open the form in netbeans, and change some property of one of the
existing controls.
The .java file should be regenerated from the .form file.
Thanks JD!
Posted by David Coldrick on August 31, 2007 at 09:24 AM EST #
Thanks for this, spent a while figuring out how to do this.
Posted by Mike Weller on October 30, 2007 at 11:23 PM EST #