Java Swing - работает на EDT

У меня есть пара вопросов относительно Swing и использования EDT для обновления графического интерфейса. Я только начал читать об этом материале, поэтому я начинающий в этой области:

Which operations are required to run on the EDT? If they don't, is simply an Exception raised? Are there any specific times when we actually are on the EDT automatically? if we schedule a task using SingUtilities.invokeLater we enqueue it to the current queue of GUI update tasks right? Accesses to the above queue I guess are synchronized, or some concurrent collection is used, but if I schedule two GUI update tasks, from two background threads, it is impossible to say which one will be added first? For instance, if Thread 1 FIRST submits a task of setting the text of a JLable to either "yes", and then, short time later, second thread comes along and submits task of setting that value to "no", are we guaranteed that the result will be "yes", or is it simply a matter of how these things are scheduled by the OS?

How exactly does the SwingWorker ensure that done() method is run on EDT? It sets the following code:

  future = new FutureTask<T>(callable) {
               @Override
               protected void done() {
                   doneEDT();
                   setState(StateValue.DONE);
               }
           };

поэтому мне было интересно, FutureTask каким-то образом гарантирует, чтоinvokeLater называется?

Спасибо за все ваши ответы.

Ответы на вопрос(4)

Ваш ответ на вопрос