wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Severe Problem with GUI Hangup? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Severe Problem with GUI Hangup?" Watch "Severe Problem with GUI Hangup?" New topic
Author

Severe Problem with GUI Hangup?

Sachindra Pratap
Ranch Hand

Joined: Jun 03, 2008
Posts: 42
hi,
I have an application, which deals with the client Server implementation.
I use to send request to UDP server and in udp server class ,JOptionPane.showmessageDialog(null,"" ) is implemented in catch block, when ever there is delay in retrieval of response from server
side.
Since udp client socket waits for particular amount of time.
I there is delay in response,or connection is not establish,
jOptionPane gets pop.

But problem is that many times,when this jOptionPane pop come gui hangs.

Please do the favour by giving any suggestion.
regards,
Sachindra
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
You know the dialogues associated with JOptionPane are all modal? Maybe better to use a non-modal display if there is a delay.
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3219
Are you doing any computationally intensive task on the event-dispatcher thread?


In Swing, lengthy initialization tasks (e.g. I/O bound and computationally expensive tasks), should not occur in the event-dispatching thread because this will hold up the dispatcher thread. If you need to create a new thread for example, to handle a job that�s computationally expensive or I/O bound then you can use the thread utility classes such as SwingWorker or Timer without locking up the event-dispatching thread.

�SwingWorker � creates a background thread to execute time consuming operations.
�Timer � creates a thread that executes at certain intervals.


Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
 
Don't get me started about those stupid light bulbs.
 
subject: Severe Problem with GUI Hangup?
 
Similar Threads
"Java Applet Window" message
Latency
How to cope up with problem of Socket Timed Out Exception?
JOptionPane.showMessageDialog
Delayed Response\Server Push