I recently learnt that Sun's/Oracle's most recent guidelines say that no Swing methods of any Swing objects, including constructors, must be called outside the EDT.
Does the same standard of rigour apply to all "visual" AWT classes too? If not, what ** are ** the rules for them?
later
re Swing and EDT: discussion from 2009.
quote: "Besides actual thread safety and associated issues like visibility and synchronization, there's I think a software issue. Swing components often have "listeners" of some type, and these listeners are designed to execute on the EDT.
Since these listeners are asynchronous and respond to events (like property changes) it's possible to have these listeners fire as you construct your GUI. The result is that some listeners are being executed on the EDT as you are constructing in your main thread, and some listeners might be running on some other thread as well (because the listener is confused and fires on the wrong thread). The result is a huge unpredictable mess."
maybe they don't know what they're talking about... but at the moment I'm taking a "better safe than sorry" approach. Also Potochkin, at http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html seems to take it as read that we are familiar with the later, stricter rules