posted 23 years ago
JApplet/Applet are both descendants of Component, so you can add them to a Swing container.
What I have done is create my applet like you normally would first. Then, to make it an applicaiton, simply create a new class with a JFrame, and add the applet as a component to that JFrame. You have to call the applet's init() and start() methods at the start of the application. But after that, it will work exactly like it did in a browser. When you are quitting your application, you proably should call stop() on the applet, to mimick what a browser does when stopping the applet.
But since an applet is really just a component, you can treat it like you would any other AWT/Swing component in your application.