Detect if Swing is installed
public class SwingSniffer extends java.applet.Applet {
public void init() {
try {
com.sun.java.swing.JButton dummy =
new com.sun.java.swing.JButton("foo");
System.out.println("Swing is here");
// getAppletContext().showDocument
// (new URL(getCodeBase()+"AppletPageWithNoArchiveTag.html"));
}
catch(Exception e) {
System.out.println("Swing is not here, you must download or install it");
// getAppletContext().showDocument
// (new URL(getCodeBase()+"AppletPageWithArchiveTag.html"));
}
}
}
<HTML><HEAD></HEAD><BODY>
<APPLET CODE="SwingSniffer.class"
HEIGHT=1 WIDTH=1>
<A HREF="/nojava.html">
Oups! You don't have JAVA enabled, click here.</A>
</APPLET>
<A HRES="lan/jre.exe">install</A>
</BODY></HTML>
找注册表的什么键啊to:wangyanqiu(*我要我的音乐*)
我要在安装程序里判断,你这个怎么弄呢?
顺便还可以知道版本:)
hkey_users\S-1-5-21-842925246-1935655697-1708537768-1003\software\JavaSoft\Java Runtime Environment\1.4.2