java - Alternative to thread for small tasks without freezing the GUI -


i'm writing small application, composed gui , couple of buttons. when user clicks 1 of them, program must download webpage, couple of matching , return value gui. question is, must start new thread every time user clicks on button, or there's alternative threads kind of small tasks ( mainly, download contents web)?

you have use different threads. how use different threads can you. @ producer/consumer method there idle thread sitting in background waiting work queued. seems fit job well. should use swingworker when possible because helps lot gui updates , refreshes. finally, @ java.concurrency package useful. days, don't think there reason start thread manually without using library locking , threading you.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -