aspose file tools*
The moose likes Applets and the fly likes Applets Vs. Netbeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applets Vs. Netbeans" Watch "Applets Vs. Netbeans" New topic
Author

Applets Vs. Netbeans

Sam Bluesman
Ranch Hand

Joined: Nov 21, 2004
Posts: 191
Hi.

I went through the tutorial at:

http://www.netbeans.org/kb/50/tutorial-applets.html

Creating an applet using the code examples is fine. However, If I try to create a GUI using the Applet form design My applets does not deploy in the web browser properly (I have tried both IE and firefox)



If I try to run this in a web browser then I just get a cross where the applet should load. what I am doing wrong?

Thanks
[ October 01, 2007: Message edited by: Ulf Dittmer ]

Moosey knows best
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41885
    
  63
What does the applet tag in the HTML look like? Are the classes in the same directory as the HTML file, including the org.jdesktop library? Are there any messages in the Java Console?
[ October 01, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Sam Bluesman
Ranch Hand

Joined: Nov 21, 2004
Posts: 191
OK. Let me start again.

Here is the code (slightly updated than before)



This is the html applet tag:

<applet code="org.me.Program" archive="HelloApplet2.jar"/>



The output of the Java console is:

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)


I have the layout extensions library containing the jDesktop library in the libraries directory of the Web Application (shown when using the Project view) and I also have it as part of the Libraries directory of the project I initally created the applet in.

Any ideas?

Thanks

[ October 01, 2007: Message edited by: Sam Bluesman ]
[ October 01, 2007: Message edited by: Ulf Dittmer ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41885
    
  63
The applet doesn't have access to either the WEB-INF/lib directory nor whatever directory NetBeans uses (apparently Libraries, according to your description). Those jars need to be in the same place HelloApplet2.jar is in, and they need to be referenced in the archive tag.
Pravin Jain
Ranch Hand

Joined: May 20, 2007
Posts: 60
Originally posted by Sam Bluesman:
OK. Let me start again.

Here is the code (slightly updated than before)



This is the html applet tag:

<applet code="org.me.Program" archive="HelloApplet2.jar"/>



The output of the Java console is:

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)


I have the layout extensions library containing the jDesktop library in the libraries directory of the Web Application (shown when using the Project view) and I also have it as part of the Libraries directory of the project I initally created the applet in.

Any ideas?

Thanks

[ October 01, 2007: Message edited by: Sam Bluesman ]

[ October 01, 2007: Message edited by: Ulf Dittmer ]


keep the jar in the same directory as your html file.


The Zen of Java Programming.
Sam Bluesman
Ranch Hand

Joined: Nov 21, 2004
Posts: 191
Thanks for that both of you: IT WORKED!
[ October 02, 2007: Message edited by: Sam Bluesman ]
 
Consider Paul's rocket mass heater.
 
subject: Applets Vs. Netbeans