Skip to main content


Showing posts from December, 2012

Long running task?? SwingWorker to help

I don't know how many people or any one now uses Swing for designing applications in Java. But while reading Java docs in my free time I came across this class called SwingWorker, now many of who work/had worked in Swing might be saying "Whats new in this class"!! Well, nothing is new in there but this class is new for me coz I never worked in Swing, but in my college days I was working on a project using Swing called Visual Java. A NetBeans kind of software, I stopped working on it when I came to know that its already there.. :)
Coming back to SwingWorker. I am writing this post for this class is because this class is really a handy for those who are developing or starting to develop applications using Swing. While developing any software if there is any long running task, we put it in a separate thread, Background thread. So SwingWorker provides us the same functionality adding some methods where we can put our UI manipulation code.
Both the classes provide doInBackgr…