    All Packages    This Package    Previous    Next

# Class awt.OptionMenu

    java.lang.Object
       |
       +----awt.Component
               |
               +----awt.OptionMenu

public class OptionMenu
extends Component

OptionMenu is a pop-up menu of choices. The current choice is displayed as the title of the menu.

Version:
  1.15 03 Feb 1995
Author:
  Sami Shaio

##

selectedIndex
  the index of the current choice for this OptionMenu

##

OptionMenu(Container, String, String)
  Constructs an OptionMenu.

##

addItem(String)
  Adds an item to this OptionMenu.
addSeparator()
  Adds a separator line to the current position in the OptionMenu.
dispose()
  Disposes of this OptionMenu.
getPreferredSize()
  Returns the natural size of the object.
itemAt(int)
  Returns the String at the given index in the OptionMenu.
map()
  Shows this OptionMenu.
move(int, int)
  Moves this OptionMenu.
nItems()
  Returns the number of items in this OptionMenu.
reshape(int, int, int, int)
  Reshapes this OptionMenu.
select(int)
  Select the given item.
selected(int)
  Overrides this method to take some action whenever the current choice for the OptionMenu changes.
selectedItem()
  Returns the current choice as a String.
unMap()
  Hides this OptionMenu.

##

selectedIndex

      public int selectedIndex

  the index of the current choice for this OptionMenu

##

OptionMenu

      public OptionMenu(Container p,
                        String label,
                        String pName)

  Constructs an OptionMenu.
  Parameters:
    p - is the parent window to contain this OptionMenu
    label - is a string describing the OptionMenu. It can be null.
    pName - is the name of this OptionMenu. This name may be signficant for layout purposes.
  See Also:
    BorderLayout

##

addItem

      public void addItem(String item)

  Adds an item to this OptionMenu.

addSeparator

      public void addSeparator()

  Adds a separator line to the current position in the OptionMenu.

getPreferredSize

      public Dimension getPreferredSize()

  Returns the natural size of the object.
  Overrides:
    getPreferredSize in class Component

nItems

      public int nItems()

  Returns the number of items in this OptionMenu. Separators don't count.

itemAt

      public String itemAt(int index)

  Returns the String at the given index in the OptionMenu.

selected

      public void selected(int index)

  Overrides this method to take some action whenever the current choice for the OptionMenu changes.
  Parameters:
    index - is the index of the current choice.

selectedItem

      public String selectedItem()

  Returns the current choice as a String.

select

      public void select(int pos)

  Select the given item.

dispose

      public void dispose()

  Disposes of this OptionMenu. It should not be used afterwards.
  Overrides:
    dispose in class Component

move

      public void move(int X,
                       int Y)

  Moves this OptionMenu.
  Overrides:
    move in class Component

reshape

      public void reshape(int x,
                          int y,
                          int w,
                          int h)

  Reshapes this OptionMenu.
  Overrides:
    reshape in class Component

map

      public void map()

  Shows this OptionMenu.
  Overrides:
    map in class Component

unMap

      public void unMap()

  Hides this OptionMenu.
  Overrides:
    unMap in class Component

    All Packages    This Package    Previous    Next