• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Tread Access in SWT

 
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
 
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 ]
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!