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.

Reply to comment | Custom Swing Components for the Java™

An impressive share! I've just forwarded this onto a co-worker who has been conducting a little homework on this. And he in fact bought me lunch because I discovered it for him... lol. So allow me to reword this.... Thank YOU for the meal!! But yeah, thanks for spending time to discuss this subject here on your website. Feel free to visit my web site; web page (Daniele)

Reply to comment | Custom Swing Components for the Java™

They're a couple of very good reasons that many folks have for owning their digital SLR camera. First, you benefit from a lot better photograph quality in comparison to the vast majority of point and shoot cameras. Furthermore, as important is the handling of the finished image you receive when you can exchange lenses to accomodate each change of conditions. SLR is an acronym for a "single-lens reflex" camera that employs a mirror and a prism mechanism giving the photographer a through-the-lens, what-you-see-is-what-you-get view. A digital camera is just an SLR acquiring the image in digital format rather than on film. Canon cameras are employed worldwide as they bring you exceptional photographs.

The LATEST chatter

  • Halted all development on the twitter client. The application in its incomplete state is available at: http://tinyurl.com/6ktd8xw 6 years 21 weeks ago
  • Java Swing Components is currently undergoing a rebranding exercise to Custom Swing Components. The url however will remain the same. 6 years 44 weeks ago
  • Java Swing Components is proud to announce the release of our rater component. http://www.javaswingcomponents.com/product/rater 6 years 45 weeks ago
  • Java Swing Components is proud to announce the release of our first bundle including a fun demo. http://www.javaswingcomponents.com/products 6 years 49 weeks ago
  • New post: New Component Teaser http://tinyurl.com/35hxfnn 6 years 50 weeks ago

User login

Syndicate

Syndicate content