
-----------------------------------
SilverSprite
Wed Jul 09, 2003 6:17 pm

help with JFrame
-----------------------------------
ok i've created an array of JFrames. everything compiles without errors but when i run the proogram and run the method and call an array slot.. the program crashes on me.. what do you think?

first[i].show() // an example of what crashes first is the array of JFrames

-----------------------------------
rizzix
Wed Jul 09, 2003 6:23 pm


-----------------------------------
have u populated the array with JFrame objects first?

The array is just an array of refrences to JFrame. u'll first need to created a new JFrame object and assgin it to a reference like this:



JFrame[] jarr = new JFrame[4];

for (int i = 0; i < 4; i++)
    jarr[i] = new JFrame();



-----------------------------------
SilverSprite
Wed Jul 09, 2003 6:39 pm


-----------------------------------
Yeah! Thanx alot.. that was the problem... man i didnt think you had to do them all.. oh wells thx again!
