Processing - Make PApplet Classes Communicate With Java Code - Stack Overflow
Processing - Make PApplet Classes Communicate With Java Code - Stack Overflow
Asked 3 years, 2 months ago Modified 3 years, 2 months ago Viewed 523 times
I am trying to use this SDK (for IntelRealSense Cameras) written in Processing in my Java
code. What I did was I took the java source code and made a project with it. So I can run
1 processing sketches directly from my Intellij Java environment using the Processing library.
My question is, can the classes that extend the PApplet class and show the sketches interact
with other classes in the Java code ( that are not PApplet s )? For example, can I create a
Main class to launch both the PApplet sketch and a vanilla Java program as well with them
being able to communicate?
The goal is to to integrate this PApplet source code into an existing Java project as a module
that can transmit information.
All in all, my objective is to : Run concurrently the PApplet and my Java program and transmit
the camera values from the PApplet to my Java Classes.
Thank you
java processing
Share Improve this question edited Nov 24, 2019 at 4:03 asked Nov 24, 2019 at 2:12
Follow Kevin Workman mMade
41.2k 9 66 104 25 7
Report this ad
Sorted by:
1 Answer Highest score (default)
I recommend you read through that, but in summary, you want to do something like this:
import processing.core.PApplet;
Note that the main() method does not have to be in the same class that extends PApplet .
This is all "just" Java, so anything that's valid in Java, is valid in a Java program that uses
Processing as a Java library.
Share Improve this answer Follow answered Nov 24, 2019 at 4:01
Kevin Workman
41.2k 9 66 104