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
Solved

Check for swing and download it without any user activity

Posted on 1999-01-26
8
156 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
  • 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

840 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