Solved

Menu Opening Notification

Posted on 1997-03-25
1
163 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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 about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

840 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