This site requires JavaScript, please enable it in your browser!
Greenfoot back
Kartoffelbrot
Kartoffelbrot wrote ...

2013/8/23

(Buggy) JLabels

1
2
davmac davmac

2013/9/6

#
You're still calling swing methods from a non-EDT. Line 55 you create a new Thread with 'this' as the runnable, in the "run" method it calls isVisible() which is a Swing/AWT method. I'm suspicious that your kind isn't thread-safe generally. I really don't think you should be messing with threads, to be honest. They may seem simple but they are actually so difficult to get right.
Kartoffelbrot Kartoffelbrot

2013/9/6

#
So what should I do now?
davmac davmac

2013/9/6

#
Either re-write your program so you don't need to create new threads, or fix all the uses of Swing/AWT methods so that they occur on the event thread (i.e. use EventQueue.invokeLater or similar as appropriate).
You need to login to post a reply.
1
2