FileDocCategorySizeDatePackage
ListDemo.javaAPI DocExample585Sun Mar 11 21:28:34 GMT 2001None

ListDemo

public class ListDemo extends Frame
Demonstrate old AWT ScrollingList. Note: You should normally use a Swing JList instead.

Fields Summary
List
list
Constructors Summary
ListDemo(String s)


	  
		super(s);
		setLayout(new FlowLayout());
		list = new List(10, false);
		list.addItem("Hello");
		list.addItem("Goodbye");
		add(list);
	
Methods Summary
public booleanaction(java.awt.Event e, java.lang.Object o)

		System.out.println(e.target + "=" + (String)o);
		return true;
	
public static voidmain(java.lang.String[] s)

		ListDemo l = new ListDemo("Up and down the list");
		l.pack();
		l.setVisible(true);