Solved

Menu Opening Notification

Posted on 1997-03-25
1
162 Views
Last Modified: 2010-04-16
Is there a way to know when a menu is about to open is its menu items can be enabled/disabled before being visible?
0
Comment
Question by:LCubed@ibm.net
1 Comment
 

Accepted Solution

by:
Doug032697 earned 50 total points
ID: 1219200
From "Java in a Nutshell," from O'Reilly & Associates (a book everybody interested in Java programming should have, IMO, because it's both handy and cheap), the only menu-related that the AWT knows about is a MenuItem generating an ACTION_EVENT.  If I've understood your question correctly, the answer is thus no.

If what you really want to know is how you can make sure the right menu items are enabled or disabled, enable them or disable them as soon as this state becomes appropriate.  In other words, if one menu selection should cause another menu item to become disabled, disable it immediately upon receiving the first menu item's event.  You can then be assured that it will be disabled the next time this menu is displayed, unless of course you have re-enabled it.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

776 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