Introduction to Java :Components Part-2
Lists
You will recall that in the SELECT widget in HTML programming, you could select how many choices were visible at any one time using the SIZE attribute. Well, since the Choice widget does not have such an attribute, you need to use a different component if you want that functionality. In the JDK, the List component is used for such circumstances.
import java.awt.*;
public class ListExample
{
public static void main(String[] args)
{
Frame baseFrame = new Frame();
baseFrame.reshape(10,10,200,200);
baseFrame.setTitle("List Example");
List list = new List(3, true);
list.addItem("Selena");
list.addItem("Eric");
list.addItem("Mark");
list.addItem("Bob Frog");
baseFrame.add(list);
baseFrame.show();
}
}
Menus and Menu Bars
Menus allow you to organize many related functions in your application in one centralized, easy-to-use interface object. Although Menus come in many forms, the most common menu types are “menu bars.”

