• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Severe Problem with GUI Hangup?

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 80874
506
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You know the dialogues associated with JOptionPane are all modal? Maybe better to use a non-modal display if there is a delay.
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic