开发者

SwingWorkers stopped working

开发者 https://www.devze.com 2023-02-12 08:23 出处:网络
I\'m having a very strange problem. I was working on an application 开发者_如何学JAVAusing Swing, and of course I\'m using SwingWorkers. They were working porperly until last night. I just ran the pro

I'm having a very strange problem. I was working on an application 开发者_如何学JAVAusing Swing, and of course I'm using SwingWorkers. They were working porperly until last night. I just ran the programm, but the workers stopped working from one run to the next. (I actually didn't change a single line of code). Was there some update or something else going on last night that could explain this strange behaviour?

I'm using JavaSE-1.6 on an OpenSuSE 11.1 box. I'm developing with Eclipse Galileo.


two things I have learnt about SwingWorkers is

  1. Java will run only one swing worker at a time (they get queued)
  2. Once swing workers complete execution, you cannot use them again. You will have to create a new instance of the swing worker if you want to run them again.


I think I have solved the problem on my own, here the solution if you're interested:

A change in the database I wasn't aware of increased the number of (dynamically created) SwingWorkers above 10, which is the maximum number of possible workers.

0

精彩评论

暂无评论...
验证码 换一张
取 消