1

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).

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Johannes
  • 2,021
  • 2
  • 23
  • 40
  • You are running Applets in a Swing GUI? Why? The Java Plug-In manager has been able to run multiple applets per JVM since 1.4. – Perception Mar 22 '12 at 21:24
  • Well, I'm using Swing-Views and Processing-Views in the same application but now I tried to enable two processing views side by side, which results in strange exceptions which don't occur when using a single processing view. – Johannes Mar 22 '12 at 21:32

2 Answers2

2

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" />

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
1

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.

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138