aspose file tools*
The moose likes Beginning Java and the fly likes Program locks up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Program locks up" Watch "Program locks up" New topic
Author

Program locks up

Matt Fyffe
Greenhorn

Joined: Jun 19, 2003
Posts: 25
Hey, I'm trying to make my program use only one JFrame instead of popping up new windows everytime it changes the screen. To do this I made a control class that would load the JPanel, wait until the JPanel finished what it had to do, then would remove it and place the next JPanel on the screen. Well, my JPanels don't seem to like that as when I try to remove the one JPanel, it simply keeps the button it clicked pressed down and no longer works. If this is not possible, is there a way I can command my JFrame to close? Here's the methods code. Note: It loads up the MainMenu class, and then the user clicks the button newGame. This is the point where it locks up. Is there a problem in my ActionPerformed class?

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Doesn't look like you give juan any action listeners. Doesn't that mean it can't respond to any actions?
Have you looked at card layout? I haven't used it, but I think it's intended for the kind of panel swapping you're doing.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Matt Fyffe
Greenhorn

Joined: Jun 19, 2003
Posts: 25
nm, I got it to work... thanks a lot for the suggestion!
[ July 10, 2003: Message edited by: Matt Fyffe ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Program locks up