{"id":1000269,"date":"2006-11-10T10:47:24","date_gmt":"2006-11-10T15:47:24","guid":{"rendered":"http:\/\/www.elharo.com\/blog\/software-development\/java\/2006\/11\/10\/awt-on-the-event-dispatch-thread\/"},"modified":"2006-11-10T17:27:34","modified_gmt":"2006-11-10T22:27:34","slug":"awt-on-the-event-dispatch-thread","status":"publish","type":"post","link":"https:\/\/www.elharo.com\/blog\/software-development\/java\/2006\/11\/10\/awt-on-the-event-dispatch-thread\/","title":{"rendered":"AWT on the Event Dispatch Thread?"},"content":{"rendered":"<p>Last night I was teaching my Intro Java class about Swing windows, and specifically discussing the event dispatch thread. I <a href=\"http:\/\/www.cafeaulait.org\/course\/week8\/40.html\">dutifully warned<\/a> everyone that all creation and update of Swing components had to happen on this thread, usually by calling <code>SwingUtilties.invokeLater()<\/code>. Then one of my students asked a question that stumped me:<\/p>\n<p>Is the same true for AWT components?<br \/>\n<!--more--><\/p>\n<p>It certainly seems logical that this be the case. However, I don&#8217;t ever remember anyone ever saying this. Googling didn&#8217;t find anything that squarely addressed this question. All the information I found about <code>SwingUtilties.invokeLater()<\/code> and related subjects seemed to focus very specifically on Swing, not the AWT. The single exception was this <a href=\"http:\/\/en.wikipedia.org\/wiki\/Event_dispatching_thread\">Wikipedia article<\/a> but I&#8217;m not sure I can trust that on such a fine technical point. Does anyone happen to know the answer to this question for sure? If the answer is no, the AWT components don&#8217;t need to use <code>SwingUtilties.invokeLater()<\/code> or equivalent, I&#8217;d also be curious why they don&#8217;t compared to Swing components which do. Is there an AWT expert in the house? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last night I was teaching my Intro Java class about Swing windows, and specifically discussing the event dispatch thread. I dutifully warned everyone that all creation and update of Swing components had to happen on this thread, usually by calling SwingUtilties.invokeLater(). Then one of my students asked a question that stumped me: Is the same [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[410],"class_list":["post-1000269","post","type-post","status-publish","format-standard","hentry","category-java","tag-flash"],"_links":{"self":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1000269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/comments?post=1000269"}],"version-history":[{"count":0,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1000269\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/media?parent=1000269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/categories?post=1000269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/tags?post=1000269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}