jQuery in Action, 3rd edition
The moose likes Applets and the fly likes JApplet and org.jdesktop.layout.GroupLayout Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "JApplet and org.jdesktop.layout.GroupLayout Error" Watch "JApplet and org.jdesktop.layout.GroupLayout Error" New topic

JApplet and org.jdesktop.layout.GroupLayout Error

Ana Sousa

Joined: May 09, 2011
Posts: 3
Hi. I'm having some hard time trying to convert my swing app into japplet.
When i run the appletviewer it works just fine, but when i try run it on a browser it keeps saying this

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3137)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at sun.plugin2.applet.Plugin2Manager$13.run(Plugin2Manager.java:3061)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
at java.awt.EventQueue.access$000(EventQueue.java:86)
at java.awt.EventQueue$1.run(EventQueue.java:639)
at java.awt.EventQueue$1.run(EventQueue.java:637)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.GroupLayout$Group
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 20 more
Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group

I've looked everywhere for this error and everyone says the same thing:
- swing-layout-1.0.jar and applet.jar must be in the same folder as index.html and must be referenced this index with the archive tag. i've done it.
- i also saw it could be a problem with netbeans using automatic layout generation so i set it up to standard java 6 code too.

But it keeps saying the same
This is an assignment for school and i really need this to work.

any suggestions?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
Post the APPLET tag and the file/directory layout.
Ana Sousa

Joined: May 09, 2011
Posts: 3
My applet:
<applet archive="swing-layout-1.0.jar,AppletClient.jar"
width="702" height="555">
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
So swing-layout-1.0.jar and AppletClient.jar are both in the same directory as the HTML file?

(I took the liberty of removing the code from your post, as it is not relevant to the problem at hand.)
Ana Sousa

Joined: May 09, 2011
Posts: 3
Yes they are... i already found another way to solve my problem which is drawing everything and placing it by my self (with GridBagLayout), but it is taking some time. i would still like to see my question solved.

Thanks in advance
I agree. Here's the link: http://aspose.com/file-tools
subject: JApplet and org.jdesktop.layout.GroupLayout Error
It's not a secret anymore!