We are about to switch to a new forum software. Until then we have removed the registration on this forum.
So I need to make an app with two windows. I got this code online and it works but I cant load an image into it (the commented out part is mine). Any idea why the app freezes when I try to run it while loading an image?
class PWindow extends PApplet { // PImage[] subs = new PImage[2]; // String testKey="m"; PWindow() { super(); PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}void settings() { size(1920, 1080); }
void setup() { background(150); // subs[0]=loadImage("test.png"); }
void draw() { //if (keyPressed && key == testKey.charAt(0)){ // image(subs[0], 0,0); println("well it works"); //} }
void mousePressed() { println("mousePressed in secondary window"); } }
Answers
Where are you creating an instance of the PWindow class?
https://Forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
https://Forum.Processing.org/two/discussions/tagged/--sketch-path
https://Forum.Processing.org/two/discussion/16457/size-method-for-intial-window-not-working-when-more-windows-are-are-added#Item_1