I am not sure if this is the one that you are looking for.
Let the class extends the JApplet as follow:
public class calcg extends JApplet implements ActionListener {
.....
// Initialize the applet
public void init() {
new calcg();
}
public calcg() {
//Create Title
//super("Calculator");
...
//Set size and make visible
//setSize( 190, 225 );
//setVisible( true );
//setResizable( false );
}
public void actionPerformed(ActionEvent ae) {
...
}
public static void main(String[] args) {
calcg application = new calcg();
JFrame frame = new JFrame("Calculator");
frame.getContentPane().add(application);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(..,..);
frame.setVisible(true);
}
}
By doing this, the application can be run as a standalone
and as an applet.
I hope this will help to solve your problem.