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

Username:   Password: 
 RegisterRegister   
 problems with removing and adding swing components.
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
facultyofmusic




PostPosted: Sat Sep 26, 2009 9:37 pm   Post subject: problems with removing and adding swing components.

Hello again, I've started on my game and I'm stuck on a part that has to do with swing, here's situation:

I have a game window (GameApp.frame).
I have a main menu (MainMenu(GameApp.frame) extends JPanel).
Inside MainMenu it will make the menu and add it self to the game window.

the above all went smoothly, but here's the problem.

I press options, the MainMenu remves itself from the game window by calling the remove method of the frame.
MainMenu makes a new instance of class Options.
the Options class is another class just like MainMenu that extends JFrame.
Options adds itself to the game window.

This is where the problem occurred. After The MainMenu removes itself and the Options adds itself to the frame, it won't show. I tried calling update() after finish initializing the options, but it still won't show.

I don't know the reason to this, has anyone else ever encountered something similar to this? If you have, what's wrong with my code? Confused
Sponsor
Sponsor
Sponsor
sponsor
andrew.




PostPosted: Sat Sep 26, 2009 9:46 pm   Post subject: RE:problems with removing and adding swing components.

You should post the code so we can look through it.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: