• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tread Access in SWT  RSS feed

 
Nrapendra Sharma
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i am working on a desktop application in SWT.. My app needs to fetch data from network at regular basis..
right now when i m fetching data UI tends to hang up and if there is any exception in fetching process GUI needs to be restarted.
it may be bcz request is going from same thread...

Can someboody tell me what are the best practices for sending network requests so that my UI dont hang up...
any sample code will be appritiated

Regards,
Nrapendra
 
Ted Smyth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try SwingWorker.

Maybe there's an SWT equivalent, I'm not familiar with SWT, but that shouldn't matter.
[ June 20, 2008: Message edited by: Ted Smyth ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, either way the issue is that you can't do anything on the GUI thread that takes any time; if you need to trigger network data transfers based on GUI actions, then that needs to be done on a separate thread.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!