There\'s a third-party applet that I\'d like to embed in my Swing application. Basically, I\'d like it to be just another panel. This applet makes use of many parameters,
For a full applet environment, you have to implement AppletContext
and AppletStub
(see Andrew's answer for a minimal example), and then pass the last one to setStub
of your applet after creating the instance with the constructor. You also should take care of calling the applet's lifecycle methods init()
, start()
, stop()
and destroy()
(after setting the applet stub).
The Applet.getParameter()
method simply delegates to the applet stub, thus in your special case it might be enough only implementing AppletStub (the needed methods of it) and pass this, ommiting the AppletContext. You might also get away without calling some or even all of the lifecycle methods.