Package com.ms.awt |
![]() Previous |
![]() Microsoft Packages |
![]() Index |
![]() Next |
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(); }
The MenuItemX class creates a menu item that can be subsequently added to a menu bar.
public MenuItemX(String s, int i1, int i2)Creates a menu item having the given name, identifier and flags.
Return Value:
No return value.
Parameter Description s The name (label) of the menu item. i1 The identifier value. i2 The flags value. Can be a combination of these values:
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 menut item in the menu.
public void Check(boolean val)Checks or unchecks the menu item.
Return Value:
No return value.
Parameter Description val Checks the item if true, unchecks the item if false.
public boolean isChecked()Returns a value indicating whether the menu item is checked.
Return Value:
Returns true if the item is checked, false otherwise.
public int getID()Returns the identifier set for the menu item by the constructor.
Return Value:
Return the identifier.
public void setState(boolean t)Sets the item state.
Return Value:
No return value.
Parameter Description t The state to set. Remarks:
This method carries out no action.
public synchronized void addNotify()Notifies the component when an item is added.
Return Value:
No return value.