• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to get plugin version!!!!

 
mehul savalia
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In our current application we have to determine the java plugin version on the client machine!

we have developed one applet which will set the pluging version in one of its public variable and we are trying to access that varibale from java script.

My applet code is

import java.applet.*;
import java.awt.*;


public class JavaVersionDisplayApplet extends Applet
{ private Label m_labVersionVendor;
String version;
public void init(){

version=System.getProperty("java.version");

}

public JavaVersionDisplayApplet() //constructor
{ Color colFrameBackground = Color.pink;
this.setBackground(colFrameBackground);
m_labVersionVendor = new Label (" Java Version: " +
System.getProperty("java.version")+
" from "+System.getProperty("java.vendor"));
this.add(m_labVersionVendor);
version=System.getProperty("java.version");
}
public String getJavaVersion(){
return System.getProperty("java.version");
}
}



and my html code is


<head> <title>TTTT</title> </head>

<body>
<OBJECT id="JavaVersionDisplayApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" name="JavaVersionDisplayApplet" WIDTH = "100%" HEIGHT = "100%" codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_3_1_02-win.cab#version=1,3,1,2">
<PARAM NAME = "CODE" VALUE = "JavaVersionDisplayApplet.class" />

<PARAM NAME = "type" VALUE = "application/x-java-applet;version=1.3"/>
<PARAM NAME="MAYSCRIPT" VALUE="true">

</OBJECT>
</body>
<SCRIPT LANGUAGE="JavaScript">
var pluginVer = 1.2;
alert("ms1"+document.JavaVersionDisplayApplet.version);
try {

if (document.JavaVersionDisplayApplet.version != null) {
pluginVer = document.JavaVersionDisplayApplet.version.substring(0,3);
//pluginVer = document.myApplet.getJavaVersion().substring(0,3);
}
}
catch (e) {
}

if (pluginVer >= 1.4) {
alert("1_4 ["+pluginVer+"]");

}
else {
alert("1_3 ["+pluginVer+"]");

}
</SCRIPT>
</html>

now with plugin version 1.4 this code is works fine and with 1.3 it is not working
can anyone tell me why its like that?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic