Package com.ms.awt Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class MenuItemX

Constructor , Methods

public class MenuItemX extends CheckboxMenuItem
{
	// Constructor 
	public MenuItemX(String s, int i1, int i2);

	// Methods
	public void Check(boolean val);
	public boolean isChecked();
	public int getID();
	public void setState(boolean t);
	public synchronized void addNotify();
}

Creates a menu item that can be added to a menu bar.


Constructor


MenuItemX

public MenuItemX(String s, int i1, int i2);

Creates a menu item having the given name, identifier and flags.

Return Value:

No return value.

ParameterDescription
s Name (label) of the menu item.
i1 Identifier value.
i2 Flags value. Can be a combination of the following:
POPUP Creates a popup menu having the given name (label).
CHECKED Places a check mark next to the menu item name.
SEPARATOR_NEXT Creates a menu item separator immediately after the given item.
ENDMENU Marks the last menu item in the menu.


Methods


Check

public void Check(boolean val);

Checks or unchecks the menu item.

Return Value:

No return value.

ParameterDescription
val Checks the item if true, unchecks the item if false.


isChecked

public boolean isChecked();

Retrieves a value indicating whether the menu item is checked.

Return Value:

Returns true if the item is checked, or false otherwise.


getID

public int getID();

Retrieves the identifier set for the menu item by the constructor.

Return Value:

Return the identifier.


setState

public void setState(boolean t);

Sets the item state.

Return Value:

No return value.

ParameterDescription
t State to be set.

Remarks:

This method carries out no action.


addNotify

public synchronized void addNotify(); 

Notifies the component when an item is added.

Return Value:

No return value.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.