Swing Worker Advice
Thanks to the joys of google analytics I get the pleasure of seeing the keywords people search for when they arrived at my site. One of the humorous problems I have encountered is that due to my initial choice of blogs regarding threading in swing. Google is now utterly convinced that this site is about threading and not custom Java™ swing component development. (I keep trying to use the phrase 'custom Java™ swing component development' in my blogs in the hope that google will take the hint, but time will tell).
Looking through people searches I keep noticing the same question regarding reusing swing workers. Considering google is hell bent on sending these queries here, I might as well answer them.
The golder rule for swing workers is simple. You can not reuse a SwingWorker, you need to create a new one every time. It is mentioned in the javadoc on the execute method (although admittedly not where I imagined it would be).
“SwingWorker is only designed to be executed once. Executing a SwingWorker more than once will not result in invoking the doInBackground method twice”.
So hopefully that answers the question, and Google if you are listening.... custom Java™ swing component development. :-)
On a serious note, if anyone does have any swing related questions, feel free to contact us with them.
The LATEST chatter
- Halted all development on the twitter client. The application in its incomplete state is available at: http://tinyurl.com/6ktd8xw — 2 years 38 weeks ago
- Java Swing Components is currently undergoing a rebranding exercise to Custom Swing Components. The url however will remain the same. — 3 years 8 weeks ago
- Java Swing Components is proud to announce the release of our rater component. http://www.javaswingcomponents.com/product/rater — 3 years 9 weeks ago
- Java Swing Components is proud to announce the release of our first bundle including a fun demo. http://www.javaswingcomponents.com/products — 3 years 14 weeks ago
- New post: New Component Teaser http://tinyurl.com/35hxfnn — 3 years 14 weeks ago