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

x
?
Solved

switch applet vs. japplet depending on java version

Posted on 2004-03-21
7
Medium Priority
?
1,088 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
  • 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
Independent Software Vendors: 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 1000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.
Suggested Courses

963 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