Solved

Check for swing and download it without any user activity

Posted on 1999-01-26
8
153 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
 
LVL 8

Accepted Solution

by:
diakov earned 200 total points
ID: 1234729
Thanx.
<lock>
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
count11 challenge 6 47
pairs challenge 5 45
Systems talking to each other 5 110
Java DateChooser? 2 13
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
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…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

760 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

21 Experts available now in Live!

Get 1:1 Help Now