Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Program locks up

 
Matt Fyffe
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matt Fyffe
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nm, I got it to work... thanks a lot for the suggestion!
[ July 10, 2003: Message edited by: Matt Fyffe ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic