Solved

Swing applet deployment

Posted on 2000-02-28
6
420 Views
Last Modified: 2013-11-23
I wrote an applet using Swing. When I deployed the applet, it seemed that I have to put all the swing class into the jar file. If I missed something, the excetion should be like this:

java.lang.Error: can't load javax.swing.plaf.metal.MetalLookAndFeel
  at java.lang.Throwable.<init>(Compiled Code)
  at java.lang.Error.<init>(Compiled Code)
  at javax.swing.UIManager.initializeDefaultLAF(Compiled Code)
  at javax.swing.UIManager.initialize(Compiled Code)
  at javax.swing.UIManager.maybeInitialize(Compiled Code)
  at javax.swing.UIManager.getUI(Compiled Code)
  at javax.swing.JPanel.updateUI(Compiled Code)
  at javax.swing.JPanel.<init>(Compiled Code)
  at javax.swing.JPanel.<init>(Compiled Code)
  at javax.swing.JRootPane.createGlassPane(Compiled Code)
  at javax.swing.JRootPane.<init>(Compiled Code)
  at javax.swing.JApplet.createRootPane(Compiled Code)
  at javax.swing.JApplet.<init>(Compiled Code)

(Running with NetscapeNavigator 5.7. When running with IE5: class can not instantiated).

How can I pre-install swing on the client machine so that the jar file for the applet doesn't need to be too big? Do I need to install the packages manually for each client machine, or just put some kind of plugin on the web?
This question is applied for Netscape Navigator and Internet Explorer.
Thank you.
0
Comment
Question by:daitt
  • 3
  • 2
6 Comments
 
LVL 3

Accepted Solution

by:
slok earned 100 total points
ID: 2564158
I suspect it is your browsers runtime
environment that causes this.

To my knowledge, both IE and Netscape
runtime environment is still at 1.1

try including a Java plugin which you
can download from JavaSoft.

NOTE : you need to install the Java plugin...

http://www.javasoft.com/products/plugin/

and in your HTML, include this line
instead :

<embed type="application/x-java-applet; version=1.2.2" width=600 height="400" CODE="YourClass.class" pluginspage="http://java.sun.com/plugin/1.2/plugin-install.html"></EMBED>

hope this helps

0
 
LVL 1

Expert Comment

by:my_moon011000
ID: 2566197
I had same problem with swing applet. This code helped, just put it into HTML-page. Plugin will be uploaded if there is no swing-components on the client computer. Here is the code:

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
     width="900" height="600" align="baseline"
     codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
 <PARAM NAME="code" VALUE="Applet.class">



 <PARAM NAME="type" VALUE="application/x-java-applet;version=1.2.2">
 <PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
 <PARAM NAME="scriptable" VALUE="true">
 <COMMENT>
     <EMBED type="application/x-java-applet;version=1.2.2" width="900"
        height="600" align="baseline" code="Applet.class"

     
      model="models/HyaluronicAcid.xyz"
        pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html">
     <NOEMBED>
     </COMMENT>
            No JDK 1.2 support for APPLET!!
     </NOEMBED></EMBED>
 </OBJECT>


Change Applet.class with your applet name.
0
 
LVL 3

Author Comment

by:daitt
ID: 2567152
Thank you for your great helps. slok's answer is the basic solution, clients must go download and install the plugin themselves. my_moon's code allows my webpage to download and install the plugin automatically if it's not been installed (I'll use this code).
Who should I give the points to?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:slok
ID: 2567226
just some correction here :

the code that I posted will help the user download the plugin as well
if it detects that the user did not install the plugin.

the only reason why I ask you to download and install the plugin first
is so that you will not be prompted to download the plugin.
Rather, you will have the environment setup and ready to debug your
applet.

However, my_moon also include the HTML code for MSIE which I did not.
0
 
LVL 3

Author Comment

by:daitt
ID: 2567349
Sorry i didn't get the solutions exactly.

I got this error with MSIE code:
Cancel Java(TM) Plug-gin installation due to user's request or downloading errors.
Java applets or JavaBeans components in this HTML page will not be displayed properly in Internet Explorer. To restart the installation, please refresh the HTML page in Internet Explorer

Anyway I think I don't need the advantage for IE. I'll give slok the points.
Thanks for you two.
0
 
LVL 3

Author Comment

by:daitt
ID: 2567436
For more information about java 1.2.2 plugin for the intranet:

http://java.sun.com/products/plugin/1.2/docs/intranet.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse shortcuts 9 45
Oracle SQL syntax check  without executing 6 38
servlet example issue 6 33
Way to decrease size of apk file 9 46
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now