Swing / More than one Applet in the same JVM

324 Views Asked by At

I'm using processing(.org), the core.jar inside a Swing-GUI. Now I'm trying to initialize several views inside the GUI whereas the processing core is a simple Applet (PApplet extends Applet) and I'm currently not sure if it's possible to initialize more Applets in the same JVM/the same GUI.

Edit: Maybe I'm having trouble because of the Animation-Thread which is started/used from processing (and maybe that's why something gets messed up whereas activating exactly one view is working).

2

There are 2 best solutions below

0
Joop Eggen On

It should really pose no problems (like two applets on one HTML). If you are using Swing, maybe rather use JApplet instead of Applet.

Likely problems? Common own classes with static fields. Adherence to cycle init/start/stop/destroy. Emulation of applet.

I merely did a common code base for applet and application, and there nothing really tricky was needed.

0
Andrew Thompson On

From Next Generation in Applet Java Plug-in Technology:

An applet may force itself into its own JVM machine instance separate from all other applets if you like:
<param name="separate_jvm" value="true" />