Here's what I do, in EVERY Applet I write, which allows me to run it either
way and to discern how it is being run at runtime -Ike
public class Test extends Applet{
boolean isAnApplet = true; //at runtime, you can look at this to know if
you are running as an Applet or application
public void Test(){}
////////////////////////////////////////////////////////////////////////////
////////////////
//// Put this function in your Applet class to allow it to run as an
application also
// Applet is basically a java.awt.Panel. As such you can treat it like
a normal Panel
public static void main(String []args) {
JFrame mainFrame = new JFrame("TestFront1");
Test applet = new
applet.isAnApplet=false; //VITAL!
applet.init();
applet.start();
mainFrame.getContentPane().add(applet);
mainFrame.setSize(400,400); //width, height
mainFrame.setVisible(true);
mainFrame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
}