public class Menu
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
Menu.Item |
Item of main menu options list.
|
Modifier and Type | Field | Description |
---|---|---|
java.awt.Color |
notSelected |
Color of an item.
|
java.awt.Color |
selected |
Color of a selected item.
|
Modifier and Type | Method | Description |
---|---|---|
void |
add(Menu.Item item) |
Add an item to options list.
|
int |
getChoice() |
Returns index of the selected item.
|
Menu.Item |
getItem(int i) |
Returns i-th item from the list.
|
int |
getNumberOfChoices() |
Returns the number of items in the list.
|
void |
next() |
Changes the next option to 'selected' state.
|
void |
previous() |
Changes the previous option to 'selected' state.
|
public java.awt.Color selected
public java.awt.Color notSelected
public void next()
public void previous()
public void add(Menu.Item item)
item
- an item to be added to options list.public int getChoice()
public int getNumberOfChoices()
public Menu.Item getItem(int i)
i
- index of item, starting from 0