It is possible. It is best to start working on it as an applet; you can then make it an application by just adding the main method.
The main method could look likepublic static void main(String[] args) {
final Applet myapplet = new MyApplet();
final Frame f = new Frame("Applet runner");
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
f.hide();
myapplet.stop();
myapplet.destroy();
myapplet.dispose();
f.dispose();
System.exit(0);
}
});
f.add(myapplet);
myapplet.init();
myapplet.start();
f.show();
}
Of course you could add listeners for other window events etc.