Solved

switch applet vs. japplet depending on java version

Posted on 2004-03-21
7
1,065 Views
Last Modified: 2007-12-19
I have two chat rooms, one based on Applet, one based on JApplet.  I want the JApplet to be used if the JVM version supports it.

I know to get the version (and vendor, if I like), easily enough from the System properties:
  System.getProperty("java.version")
  System.getProperty("java.vendor")

But I can't think of anything nifty for a way to actually manage classloading or whatnot.  I'm already inside the instantiated class when things begin, so it's already either an applet or a japplet.

I found a nifty javascript version detection script, but it only works for non-IE browsers, and I'd really prefer to do it inside a single jar; let it decide for itself.

if you go to http://nfg.ca/ you can see the chatroom (link: "chat" at the top of the screen) and see the javascript pains I'm going to at the moment. :)
0
Comment
Question by:nentwined
[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
  • 5
  • 2
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10646057
you'll need to implement that in your html, and not in your applet.
0
 
LVL 92

Expert Comment

by:objects
ID: 10646064
although you could try loading an Applet which checks the version and then embeds the required applet inside itself (applets are just components so can be added like any other).
0
 
LVL 92

Expert Comment

by:objects
ID: 10646076
probably easier though to implement in your html using the <object> tag.
0
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!

 

Author Comment

by:nentwined
ID: 10646140
can you use the object tag to specify which version of java is required for it?

I just implemented an applet which checks version and then redirects to a different page depending; that was painless enough.

As for embedding, I was worried about values being passed on down the line, such as parameters and whatnot.  But it's a plausibility.

how backwards-compatible is the object tag?
0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 10646160
The object tag can only be used for loading the plugin (and thus use JApplet), if it isn't present then you can use applet tag (to load Applet).

> I just implemented an applet which checks version and then redirects to a different page depending; that was painless enough.

thats a good solution.
0
 

Author Comment

by:nentwined
ID: 10646191
I'll have to look into the object tag.  Thanks both for your ideas. :)
0
 
LVL 92

Expert Comment

by:objects
ID: 10646203
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

726 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