How can I post a message to the eventqueue? I want to use this if a worker thread is ready with some code and wants the AWT to run some code. This code needs to support a very old browser, so I can't use any swingutils like invokeLater.

Sandip Chitale

Use a small 1 pixel by 1 pixel component somewhere in your application GUI which will not interfere your normal GUI.

In it have a vector of Runnables. This is the vector where the worker thread queues up the work requests. In the components paint method implement the code to dequeue and execute all the Runnables in the vector. Then call onePixelByOnepixel.repaint();. This should eventually call the paint(Graphics g) of the 'onePixelByOnepixel' on the AWT thread.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact