Content deleted Content added
→Swing and thread safety: Added a reference to tutorial from Oracle (former Sun) which states that UI components must be created and accessed on EDT. |
corrected a statement about other threads executing code "in" the EDT (It's impossible for thread 1 to run "in" thread 2). |
||
Line 23:
== Executing code in the EDT ==
Other application threads can
* synchronous code execution ({{Javadoc:SE|member=invokeAndWait(Runnable)|javax/swing|SwingUtilities|invokeAndWait(java.lang.Runnable)}} or {{Javadoc:SE|member=invokeAndWait(Runnable)|java/awt|EventQueue|invokeAndWait(java.lang.Runnable)}})
* and asynchronous code execution ({{Javadoc:SE|member=invokeLater(Runnable)|javax/swing|SwingUtilities|invokeLater(java.lang.Runnable)}} or {{Javadoc:SE|member=invokeLater(Runnable)|java/awt|EventQueue|invokeLater(java.lang.Runnable)}})
|