I'm trying to get an Java applet to work online. I've written the code
within Netbeans and it compiles and works fine there.
When I try and put it within a website I get the following error:
java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
at GA_colour_change.start(GA_colour_change.java:149)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
As far as I can understand this is because Netbeans uses the
GroupLayout classes when forming the GUI. I've look around the
internet for solutions, and although I don't understand them all, as
far as I can tell, if I add the missing class files to my source it
should work. So I did this, and I now have the package
org.jdesktop.layout within my source files.
The problem is that I still get the error. If I open the .jar file I
can browse all the .class files and find the file org/jdesktop/layout/
GroupLayout$Group, so why can't it find it when it runs ?
Hope I've explained correctly and given enough information.
Cheers in advance,
Ben.
But are you building the JAR file yourself?
If yes, try using NetBeans to build the JAR for you. It should be able
to sort out all the referenced classes... after all, GroupLayout is
the class used in its UI builder, isn't it?
When NetBeans build you a working JAR, then you can look inside it to
see what's different from the version you built...