Choice Menus

Some important methods of Choice:
Method Action
getItem(int) Returns the string item at the given position (starts at 0 as the first item in the menu)
getItemCount() Returns number of items in the menu
getSelectedIndex() Returns index of item that is selected
getSelectedItem() Returns the currently selected item as a string
select(int) Select item at int index position in list
select(String) Select item with the given string





Create an applet that adds a checkbox to it.
  1. you must create a Java applet with a class that extends the Applet class. (you must import the java.applet package).
  2. you should create an init() method that among other things creates a Choice object and adds elements to its list.


Here is the applet
Need Java Enabled Browser

Solution