Solved

switch applet vs. japplet depending on java version

Posted on 2004-03-21
7
1,073 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
The viewer will learn how to implement Singleton Design Pattern in Java.

729 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