Results 1 to 4 of 4
- 12-07-2010, 08:29 PM #1
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
JFrame stops working after method called through acitonListener urgent ;(
Hello!
I need to be done with this game in 2 days, I have no time for unexplainable issues like this:
In my JFrame I got a JPanel panels. Panels is connected to a CardLayout
so by calling a simple function is switch panel to display.
I can freely switch between the menu and the Players panel
But if I switch to Start game it hogs up.
The damn JFrame refure to repaint nor even respond to exit button clicks!
Tho it is working, I can see the output, but no repainting is done whatsoever on the jframe!
Why is this? I call JFrame's repaint() method yet no result! Why?
- 12-07-2010, 09:11 PM #2
Member
- Join Date
- Dec 2010
- Posts
- 27
- Rep Power
- 0
Possibly there is a infinite loop in the Thread that runs the program, that may cause the Frame not to respond, all I can say with no code posted.
- 12-07-2010, 09:24 PM #3
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Well, I didnt want to bother you with 10 classes of code each 400+ lines and attach the 100 images included.
nEITHER Can I make and example as the fk starts to work then.
I have no infinity loop going ANYWHERE except in the GameLogic. And that class in only initiated, never run before the button click.
-
Without code we can only guess, but I agree with demonick that this smells like a Swing concurrency issue, that you've likely got your own game loop going on in the game logic portion of the code, and you're calling it on the main Swing thread, the EDT (event dispatch thread), effectively freezing the GUI. Are you using a background thread such as a SwingWorker or a Swing Timer?
For better help, we'll need to see code.
Similar Threads
-
Paint(Graphics g) method is not called on its run.
By vsanandan in forum Java 2DReplies: 5Last Post: 10-22-2010, 01:55 PM -
Timer stops working :P
By Addez in forum New To JavaReplies: 13Last Post: 09-21-2010, 08:36 PM -
Why the paint() method is called two times ?
By supremo in forum New To JavaReplies: 4Last Post: 06-03-2010, 06:21 PM -
JFrame Hanging When Called From Another Class
By al_Marshy_1981 in forum AWT / SwingReplies: 5Last Post: 03-30-2010, 07:04 PM -
what made paintComponent() method to be called twice??
By Y. Progammer in forum New To JavaReplies: 5Last Post: 02-21-2010, 10:19 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks