Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Anyone familiar with Multi Thread  RSS feed

 
Adrian Lee
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, I found my UI dead (without any response) for my following program.

Someone suggested me to use multi-thread technique to modify the following function, but how can I realize this part for dispose and new()?
Any suggestions would be welcome.


Thanks in advance
 
Pradeep Kadambar
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm no expert on Swing, but you can try to use SwingWorker for your task. You can check more on this on Google.

 
Brian Cole
Author
Ranch Hand
Posts: 949
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adrian Lee:
Hi everyone, I found my UI dead (without any response) for my following program.

Someone suggested me to use multi-thread technique to modify the following function, but how can I realize this part for dispose and new()?
Any suggestions would be welcome.


Thanks in advance


Is that java.awt.Window's dispose() method? If so, the javadoc says:

Note: When the last displayable window within the Java virtual machine (VM) is disposed of, the VM may terminate. See AWT Threading Issues for more information.

So perhaps things are getting partially shut down before ui2 is made visible. I don't have time to try it, but perhaps something like this would work better:

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!