Re: Applet does not load on app server when Free Design Layout

Wade Chandler <[email protected]> Thu, 15 May 2008 12:03:00 -0700 (PDT)
Newsgroups gmane.comp.java.netbeans.user-interface
Message-ID <[email protected]>
--- fighter1in <[email protected]> wrote:
> My Question is : How can I run the applet with Free Design Layout? or is it
> possible to package the swing layout extensions in the HelloApplet.jar?
> Thanks for all your replies.
> 

First, before giving an answer, please read the descriptions of groups before posting. This is
not a general user help forum. nbusers is best suited for general questions.

The issue has to do with swing-layout not being included with your applet. There are two issues
here. One, if you target Java 1.6 only you can use its classes which come directly in the JVM.
However, others with pre-Java1.6 won't be able to run it. If you want to target 1.5+ you can use
the free-design/swing-layout and include the JARs in your application. The only catches here are 
you need to include a copy of the swing-layout JAR file in your web application, and be sure you
have the form set to use the correct classes. Put it in the same place relative to your applet
JAR file so:

somefolder
-YourApplet.jar
-swing-layout.jar

Then in your HTML where the Applet tag is defined you need to use the archive attribute and it
needs to include more than 1 jar (space delimited):
... applet archive="YourApplet.jar swing-layout.jar" ...

See:
http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html

for more information on the applet tag and read the documentation on the archive attribute. It
might make it more clear. To change the class names used for the layout classes, when you have
free design/swing-layout in use, in the Inspector window click on the very top node in the tree
view and then see the properties window and the "Layout Generation Style" property.

Wade


==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org