Pregunta

I think this is so wrong, but I need it...

So, to run Processing's sketch in Java mode, you have to extends PApplet in the main class, and there, in the setup() determine the window size using size(int x, int y). Then when you run it, it'll show a Java window Applet Viewer.

What I wanna ask is, how to prevent that window from appearing? I've tried to remove the size method, but it appeared in (what seems like) it's default size. Tried put 0 as params, went wrong (the x and y have to be > 0).

Is there any way to do that?

If there's any lack information or I've made a mistake with the post, please tell me.

1st edit - add more info

Let's say I have 2 classes: the one that implemented Processing and extends PApplet is named Pikachu by me, and an ordinary Java class I named Jojo. Jojo will pass params to Pikachu and Pikachu will process that param. The param is image's name, or if it could, an image itself (I don't know yet tho, can Processing execute Image class from Java?). Then Processing will process that image, gave an output, again as image (Yet, again I don't know yet, can Processing gave output an image for Java to use?). So, that's why I don't need a window to appear.

¿Fue útil?

Solución

Perhaps you can try to use the Frame object.

In the documentation there is a function .setVisible(boolean b) If you call .setVisible(false) you can turn the frame off.

http://docs.oracle.com/javase/7/docs/api/java/awt/Window.html#setVisible(boolean)

I am not sure how to access the frame using pure Java. In processing you can simply call

frame.setVisible(false);

Hope this helps

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top