Could you please explain me Swing Threading model. splly invokeLater
method. I am experinced C++ programmer , but new to java.
Should we create another thread in event handler.
pls explain me concepts
A normal Java app has many threads, most of which putter away it he
background invisibly. Swing does all its GUI painting on one thread.
This means it has no problems co-ordinating what it dose . It
basically sits in a loop reading events and dispatching them, then
when the event has been handled or a bit of painting done, it pops the
next one off the queue.
to make sure you don interfere with this process you must do most of
your Swing work on the Swing thread, e.g. in your event handlers.
You can create a sort of event and add it to the queue with
SwingUtilities.invoke later. You pass it an object with a run method.
When you packet makes it to the head of the queue it calls your run
method. It does not start up a new thread.
See http://mindprod.com/jgloss/swing.html
http://mindprod.com/jgloss/jgloss/threadsafe.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
What could be possible cause of error