• Post Reply Bookmark Topic Watch Topic
  • New Topic

Event Dispatch Thread

 
Nuwan Arambage
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I have gone through regarding thread & swing components.I have got to know that most of the event are being handling by the event dispatch thread.So my question is this, When I create GUI inside main method, does all event handling occurs in the main thread with no help of event dispatch thread or . does main method implicitly call the event dispatch thread.

Thanks & Regards,

Nuwan Arambage


 
Stephan van Hulst
Bartender
Posts: 6583
84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main thread will create the GUI, unless you explicitly tell the EDT to do the work (SwingUtillities.invokeLater()).

It is okay, as long as you don't perform any actions on the GUI anymore after the EDT has started up (either trough invokeAndWait(), invokeLater(), pack() or setVisible()).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!