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
- Java will run only one swing worker at a time (they get queued)
- 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.
精彩评论