Hey everyone
I have never posted to a fourm before so please correct me if i am lacking etiquette. I am sandboxing having 2 processing windows, each with the capability to be resized. The software is to control LED cubes. You can see the progress here:
https://github.com/spudstud/All-Spark-Cube.
Here is the code I have been experimenting with. It draws 2 windows, but when you try and resize the window the application crashes (Running OSX 10.7, Processing 1.5.1, Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720).
I'd really appreciate some advice from anyone who has got multiple frames working.
import processing.opengl.*;
PFrame aPFrame;
secondApplet aSecondApplet;
void setup() {
size(320, 240, OPENGL);
frame.setResizable(true);
PFrame aPFrame = new PFrame();
aPFrame.setTitle("Second JFrame");
}
void draw() {
background(255,0,0);
//aSecondApplet.background(0, 0, 255);
//aSecondApplet.fill(100);
//s.rect(10,20,frameCount0,10);// default line, wont compile
aSecondApplet.redraw();
ellipse(40,40,40,40);
}
public class PFrame extends Frame
{
public PFrame()
{
setBounds(100,100,400,300);
aSecondApplet = new secondApplet();
add(aSecondApplet);
aSecondApplet.init();
show();
}
}// end PFrame
public class secondApplet extends PApplet
{
public void setup()
{
size(400, 300, OPENGL);
noLoop();
}// end setup
public void draw()
{
background(0,0,255);
ellipse(30,30,30,30);
}// end draw
}// end secondApplet
1