From: Joonas P. <joo...@ik...> - 2009-11-25 11:27:28
|
Hello, Swing's thread policy has apparently been getting stricter over years, and as mentioned for example here: http://stackoverflow.com/questions/491323/is-it-safe-to-construct-swing-awt-widgets-not-on-the-event-dispatch-thread It's "illegal" to even _construct_ Swing widgets outside the event dispatch thread, let alone manipulate them. In other words, code like this http://jythonpodcast.hostjava.net/jythonbook/chapter16.html works, strictly speaking, only by coincidence, unless the code is explicitly launched on the EDT - and generally it isn't. This is a pity, since Jython's other features regarding Swing are quite nice, making the code concise and clear. Is there a simple workaround this? Should some "thread safety help" be built into core Jython? How have you people dealt with this issue - building workarounds, or simply Swinging outside the EDT by luck? Best Regards, Joonas |