Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Event Dispatch Thread

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Saloon Keeper
Posts: 13852
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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()).
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic