This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi I am a swing programmer. I want to know if I can use threads in my swing application that I am developing. I also want to know if I can make some classes abstract/intreface so that in future i could use them while programming.
Yes, you can definitely use threads. In fact, anything that is going to take some time to process (i.e. database reads, i/o activity, etc) you should consider moving the processing of those tasks to another thread.
The problem if you don't is that they block your Swing Event Thread from processing any GUI activity which results in a perceived application lockup to the end-user because the GUI will not respond until the offending method call finishes and unblocks the EVT (event thread).
Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis. -Jack Handy
The essential thing to remember with threads is the magic paradigm - "never update a control on a thread other than the event thread". This means that you have to manage access to controls from any worker thread.