Applet does not load on app server when Free Design Layout
fighter1in <[email protected]> Thu, 15 May 2008 11:05:36 -0700 (PDT)
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <[email protected]> |
Hi, I have to embed a an applet in a webpage of an web application. Before I go on to anything.. let me first tell you, I am using Netbeans 6.0 As shown in the tuorial: http://www.netbeans.org/kb/articles/tutorial-applets-40.html 1. I first made the "Applet" source say HelloApplet. java. After compiling and running it I get the HelloApplet.jar. 2. I created a WebApplication and then from the properties -> packaging -> I "Add Project" HelloApplet.jar. 3. Then I a webpage I "embeded" the applet. 4. I run the web app and the applet gets loaded and everything is just fine. But before I go on I must tell you that the applet was designed in Null Layout. Now I edited the applet source once again and changed the layout to Free Design Layout. ( this is available from Netbeans..on the HelloApplet.java .. go to the design view.. right click on the form and from the context menu you can change the layout to FreeDesign or whatever you might want). When I expand the "Libraries" node I see the that the library Swing Layout Extensions - swing-layout-1.0.3.jar has been added. When I "run" the "HelloApplet.java" file, the applet is shown in the appletviewer. No problems with that. But! When I try to Clean & Build and Run the WebApplication, the applet does not get loaded. On inspecting the java console I see the following error: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.GroupLayout$Group at sun.applet.AppletClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 10 more It clearly shows that the Free Design Layout has something to do with the GroupLayout which can be found by expanding the "Swing Layout Extensions - swing-layout-1.0.3.jar". Now when the HelloApplet.jar is created only the HelloApplet.class file gets included together with some other data but NOT the swing extensions. Hence when I run the web app the class file looks for the GroupLayout.class definition but can find it in the jar as its not included when the HelloApplet.jar is created. But with null layout there isint a problem because null layout takes the definitions from the JRE on the machine.. and so it runs without a hitch. 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. Cheers. -- View this message in context: http://www.nabble.com/Applet-does-not-load-on-app-server-when-Free-Design-Layout-tp17259115p17259115.html Sent from the Netbeans - UI mailing list archive at Nabble.com.