• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Decoupling AWT menu threads

OK here is the situation, I have an applet with a load of awt popupMenus.  When a popupMenu is being displayed all painting stops.  If I am using the Sun JVM (v1.4) opening a subsequent popupMenu leaves the first one on screen (it just isn't painted over).

Clearly while the popup menu is open the AWT thread is being halted, so I try decoupling to a new thread to open the popup menus.  This works fine until I try it on Mac OS X, where that little spinning colour wheel appears (the hourglass equivalent) for about 15 seconds after opening the menu.  Until it turns back into a pointer you can't use any of the UI.

So the question is how can I decouple showing the menus to a new thread without making things unusable on the Mac?
0
g_clarke
Asked:
g_clarke
1 Solution
 
objectsCommented:

Why is the ui thread stopping a problem for you?
0
 
g_clarkeAuthor Commented:
Because the applet contains dynamic content that doesn't get updated while the menus are open.  Also on the Sun 1.4 JVM opening one menu immediately after another stops the painting thread, so as a result the original menu appears to be left on screen (that part of the screen just hasn't repainted yet).
0
 
objectsCommented:
Ensure you popup the menu from the event dispatch thread.
http://developer.java.sun.com/developer/bugParade/bugs/4835538.html

Also may be related to this bug:
http://developer.java.sun.com/developer/bugParade/bugs/4049083.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
CleanupPingCommented:
g_clarke:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
jimmackCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept objects' comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jimmack
EE Cleanup Volunteer
0
 
objectsCommented:
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now