Solved

Check for swing and download it without any user activity

Posted on 1999-01-26
8
155 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java - Why doesn't this JFrame work 3 59
Spring Framework HTTPSession management 1 36
Facing this issue for maven proxy setting 2 12
mysql jsp example issue 32 38
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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 …
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 …

809 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