Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Check for swing and download it without any user activity

Posted on 1999-01-26
8
Medium Priority
?
161 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Accepted Solution

by:
diakov earned 800 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.
Suggested Courses

926 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