Hi, I'm trying to make an application that has a toolbox. The toolbox has a file menu in which there are(or will be) the standard commands of New, Open, Save, etc...
My problem is that I want to be able to have multiple document windows open and visible at a time. I'm familar with VB in which you would use an object array, however, I tried this technique in Java using the following line of code, and the command prompt filled with text while the app did nothing:
Life is 10% what happens and 90% how you react to it.
Attitude is everything.
That's all pretty close; the only problem is that declaring an array variable -- or any variable that's not a primitive type like int, double, float, short, char -- creates only a reference to an object, not the object itself. Your array variable is "null", meaning it points to no array at all. The "console filling with text" is stack dumps resulting from a NullPointerException being thrown when you try to add an element to that non-existent array object.
You have to actually create the array:
public ImageFrame canvas = new ImageFrame;
That creates an array that would hold ImageFrames. Java arrays have a fixed size. If you need something that might grow over time, look at the java.util.ArrayList class.