Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

My Swing GUI is being blocked when the application runs

807606Mar 1 2007 — edited Mar 3 2007
Hi,

I've got this weird problem that whenever I press 'run' button to execute the program, the GUI gets locked up. i.e. it refuses to allow me press any other buttons (e.g. 'pause') and doesn't refresh the graph (e.g. some dynamic output that should be displayed while the underneath program is running).

I've read about people saying you should use SwingUtilities.invokeLater method, but I think I am using it given the code generated by Visual Editor in eclipse:
        public static void main(String[] args)
	{
		SwingUtilities.invokeLater(
			new Runnable()
			{
				public void run()
				{
					GameGui application = new GameGui();
					application.getJFrame().setVisible(true);
				}
			}
		);
	}
Can someone please point me to the right direction to solve this problem as I'm not very familiar with threading concept in Swing? Many thanks.

Message was edited by:
cyaevan

Message was edited by:
cyaevan

Message was edited by:
cyaevan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2007
Added on Mar 1 2007
15 comments
291 views