On 11/1/07, Karthik <Kart…@sun.com> wrote:
Can you try the following: Tools | Options | Advanced Options | Options | Editing | GUI Builder Set ‘Layout Generation Style’ to ‘Swing Layout Extensions Library’.
The option may not affect existing forms; but new forms should use the library rather than ‘Standard Java 6 Code’.
You are right, this works well for new forms. I’ll leave this setting at ‘Automatic’ though, see below.
Another alternative is to use ‘Tools | Java Platform | Add Platform’ to add a jdk5 or jdk1.4 platform to the ide’s list of known platforms and then use ‘Project Properties | Libraries | Java Platform’ to set the project’s platform to the newly added platform.
I had forgotten to change the Java Platform of my project, thanks for the tip! When I set the Java Platform to JDK 1.4.2 (or 1.5.0) the GUI builder is using the extensions library instead of Java 6 code for new forms.
Existing forms are not changed, and show up with errors in the editor. The easiest way to fix this I believe is to open each class that is using the generated Java 6 code, selecting the Form in the Inspector panel, and changing its Layout Generation Style in the Properties panel.
My app is now able to launch in all the JVM versions I’ve tried so far – thanks for helping out!
Of course, using jdk1.6 with ‘source/binary format’ set to 1.5 should be equivalent to setting the project’s platform to 1.5. By default ‘Layout Generation Style’ is set to automatic, which should use extensions library if ‘source/binary format’ is set to 1.5. If not, that is a bug; you may want to file an issue at http://www.netbeans.org/community/issues.html .
I filed this as issue number 120933. Thank you again for your help!