Yes, you are quite right: that is a beginners mistake.

You should read about swing and threading. A short resume is give in the 
package description of javax.swing.

To eliminate your problem quickly you should do two things:

1: All GUI activity must be controlled from the event dispatch thread (EDT). 
The simplest way is to invoke from your main method 
SwingUtilities.invokeLater(). From now on everything is running on the EDT, 
(unless you later decide to start some thread).

2: The time consuming task should NOT be run on the EDT (because if it would 
run on the EDT, the EDT can do nothing else, like responding to mouse clicks or 
whatever). Create a Thread with a Runnable for that purpose.

Hope this helps

Piet
[Message sent by forum member 'pietblok' (pietblok)]

http://forums.java.net/jive/thread.jspa?messageID=294966

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to