?
Solved

Decoupling AWT menu threads

Posted on 2003-03-19
6
Medium Priority
?
199 Views
Last Modified: 2010-03-31
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
Comment
Question by:g_clarke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 8169671

Why is the ui thread stopping a problem for you?
0
 

Author Comment

by:g_clarke
ID: 8193767
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
 
LVL 92

Accepted Solution

by:
objects earned 1050 total points
ID: 8198095
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
Technology Partners: 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!

 

Expert Comment

by:CleanupPing
ID: 9058596
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
 
LVL 15

Expert Comment

by:jimmack
ID: 9727252
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
 
LVL 92

Expert Comment

by:objects
ID: 9734819
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question