PApplet question

Thread Starter

krow

Joined May 25, 2010
49
Hello, in this example I have two applets which I'm running as a Java Application. This might sound silly but how can I close one of the windows so that the other one remains open? because every time I close it my program just ends.

Normally, if I were using an ordinary frame I would write "myFrame.setVisible(false);" but I don't know how to do that with applets. On the PApplet webpage it says that 'set'Visible()' is inherited from java.awt.Component. Problem is, I just don't know how to call the setVisible method from an applet.

Thanks for your help.

Rich (BB code):
import processing.core.PApplet;

public class Class1 extends PApplet {

    public void setup() {
        size(200, 200);
        background(0);
    }

    public void draw() {

    }

    public static void main(final String[] args) {
        PApplet.main(new String[]{"Class1"});
        PApplet.main(new String[]{"Class2"});
    }
}
Rich (BB code):
import processing.core.PApplet;

public class Class2 extends PApplet{
    
    public void setup() {
        size(400, 400);
        background(0);
    }

    public void draw() {

    }
    
}
 
Top