Solved

Check for swing and download it without any user activity

Posted on 1999-01-26
8
158 Views
Last Modified: 2013-11-23
Hi Experts,

I made an applet using some swing classes. I want to include a code that checks whether swing installed on machine where applet is running. If swing not installed, how can I download and install it invisibly (I mean without any user activity) so my applet can run normally? Please provide source code.

Thanks in advance
Stanislav
0
Comment
Question by:spokraev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:sailwind
ID: 1234726
The way you would do this is by using Java Plugin. Unfortunately,
there is no way to do it invisibly. For IE users, they can simply
click on the applet, and the active desktop will download/install
and run it right away. However, for netscape users, they will
have to click on the applet, click okay to save the plugin file,
run the plugin, and restart netscape. There is simply no other
way to do this, and the plugin has already simplified the
process by quite a bit.

The site is:
http://www.java.sun.com/products/plugin/

Please look at this site for the exact html syntax.

Here's what my html code for the plugin looked like:

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"

        width="120" height="160" align="left"



codebase="http://java.sun.com/products/plugin/1.1/

jinstall-11-win32.cab

#Version=1,1,0,0">



<PARAM NAME="code" VALUE="Your_Applet_Class.class">

<PARAM NAME="type" VALUE="application/x-java-applet;version=1.1">

<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">





<COMMENT>

        <EMBED type="application/x-java-applet;version=1.1"

                width="120" height="160" left

                code="Your_Applet_Class.class"

pluginspage="http://wwwin-people.cisco.com//tolin/plugin-111-win32.exe">

        <NOEMBED>

</COMMENT>

        No support for JDK 1.1 applets found!

        </NOEMBED>

        </EMBED>

 </OBJECT>    
0
 
LVL 8

Expert Comment

by:diakov
ID: 1234727
You can as well provide the Swing along with your code (swingall.jar in the archives tag of the HTML)

0
 

Author Comment

by:spokraev
ID: 1234728
I had difficulties with sailwind's solution. Couldn't make it work. Diakov's suggestion worked and actually it satisfies me.

Anyway thanks for your quick response.

Diakov please post your comment as answer.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
diakov earned 200 total points
ID: 1234729
Thanx.
<lock>
0
 
LVL 3

Expert Comment

by:sailwind
ID: 1234730
Hmm.. never thought about that possibility. Few questions:

1) Would the jar be downloaded immediately and allow the applet
   to run right away?

2) Does this implementation work on all platforms and both
   browsers?

3) is the swingall.jar smaller than the plugin?

Thanks for the explanations
0
 
LVL 8

Expert Comment

by:diakov
ID: 1234731
As far as I know, swingall.jar is about 2M. The ARCHIVE entry of the applet tag works on all browser. The idea is to put your code into one jar, while keeping all libraries into their original jars. Yes, it gets downloaded frist thing during initialization.

Cheers,
  Nik
0
 
LVL 3

Expert Comment

by:sailwind
ID: 1234732
I guess the benefit of the java plugin over this implementation
would be that you will not need to download the 2M archive
every time the user runs the applet. The plugin will register
itself with the browser and be called locally every time it
loads a swing applet.

0
 
LVL 8

Expert Comment

by:diakov
ID: 1234733
I have to check this, but I think that the class loader first check the local classpath (of the browser) and then the archive tag).
Another benefit of the plugin is that it enables 1.0 browsers to be 1.1 and even 1.2 compliant.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb wildfly example 2 113
Why doesn't this text field show up on my Applet frame? 2 43
Eclipse Java import and method not resolved 4 137
ArrayList Adding/settign data 3 38
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

751 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