Results 1 to 3 of 3
Thread: run something only once
- 03-11-2009, 05:46 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 15
- Rep Power
- 0
When executing screen freezes...
Hi,
I´ve encountered a new problem, every time I want to click on a button in a drawed Jframe to launch a game, it launches but it freezes... What could be the cause? Should I dispose my Jframe or just buy a faster pc? And how do I dispose my Jframe?
grtzLast edited by blackstormattack; 03-11-2009 at 09:01 PM.
- 03-11-2009, 11:34 PM #2
Member
- Join Date
- Sep 2008
- Posts
- 13
- Rep Power
- 0
are you using an IDE if so which one?
-
This has nothing to do with the IDE being used or the speed of your PC, and everything to do with trying to call long processes on the EDT or Event Dispatch Thread. This is the main thread the Swing uses to draw with and interact with the user. This suggests that you should be launching your game from within a background thread.
edit: start reading here -- Lesson: Concurrency in Swing (The Java™ Tutorials > Creating a GUI with JFC/Swing)Last edited by Fubarable; 03-11-2009 at 11:41 PM.


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks