Author: Real Gagnon
Author's WebSite: http://tactika.com/realhome/realhome.html
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(NoClassDefFoundError e) {
System.out.println("Swing is not here, you must download or install it");
// getAppletContext().showDocument
// (new URL(getCodeBase()+"AppletPageWithArchiveTag.html"));
}
}
}
NOTE: With the JDK1.2 release, it's recommended to use
import javax.swing.*;
instead of
import com.sun.java.swing.*;
<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>
</BODY></HTML>
Posted On: 5-Jul-1999