Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 help with JFrame
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
SilverSprite




PostPosted: Wed Jul 09, 2003 6:17 pm   Post subject: 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?
code:

first[i].show() // an example of what crashes first is the array of JFrames
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Wed Jul 09, 2003 6:23 pm   Post subject: (No subject)

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:

code:


JFrame[] jarr = new JFrame[4];

for (int i = 0; i < 4; i++)
    jarr[i] = new JFrame();

SilverSprite




PostPosted: Wed Jul 09, 2003 6:39 pm   Post subject: (No subject)

Yeah! Thanx alot.. that was the problem... man i didnt think you had to do them all.. oh wells thx again!
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: