In such context, I'm facing a great doubt: what if the dialog waited
for user's input? (some dialogs can do this, e.g. file chosers).
Wouldn't they blocked the event-dispatching thread?
regards,
Marcin
No. Classes like JDialog are designed to work with other objects on the EDT.
Modal dialogs block certain activities to the user, such as switching to a
different frame, but Swing does that by managing its own internal state. How
it ignores or eats the particular events can be a black box to us as
programmers. If we put our GUI on the EDT, Swing takes care of the rest.
Googling shows that this question is a FAQ. I didn't find in a quick search
whether Swing just handles modality in its main event loop or spawns a
hijacking thread. ISTR reading somewhere, somewhen that it's the latter.
--
Lew
Please do not multipost.
--
Lew