Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How to solve this problem (GUI strucking)

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am implemening one GUI application, i have a general problem;

one window of the applivation performs some operations, it takes 5 min time.
During this 5min time; the total application was strucking and i can not any other task in that window.

I appreciate your advices to come out of this problem.


Thank you,

Regards,
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need a SwingWorker thread to do the job which takes upto 5 minutes.

http://www.osc.edu/~watts/tutorials/gridview/gui-howto/gui-threads.html

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html
 
Vasu Reddy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, and i am looking in that;

Reagards,
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have a question about the previous answer.
Is the swingworker a thread or it there are any differences?
In the previous example is the swingworker class more appropriate than a single thread and why?
P.S.:I have to admit that I haven't take a look at the swingworker class, I'm just try to identify if I have to do it
[ January 13, 2006: Message edited by: hartzoua hartzoua ]
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by hartzoua hartzoua:

Is the swingworker a thread or it there are any differences?



SwingWorker is simply a convenience wrapper around the Thread class. It frees you from having to implement Runnable/extend Thread, which may be inconvenient when you are dealing with lots of GUI classes. You could use either a thread or SwingWorker to solve a problem like the one above. Which one you use is more a stylistic decision than a technical one.
Have a look at the How To Use Threads In Swing page from the Java Tutorial for some examples.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic