/**
* @(#)TestChoice.java
*
* TestChoice application
*
* @author
* @version 1.00 2007/1/20
*/
import java.awt.*;
import java.awt.event.*;
public class TestChoice extends Frame
{
Choice ch=new Choice();
public TestChoice()
{
FlowLayout fl=new FlowLayout();
setLayout(fl);
ch.add("choice1");
ch.add("choice2");
ch.add("choice3");
add(ch);
ch.addItemListener(new ItemListener()
{
public void itemStateChanged(ItemEvent e)
{
System.out.println(e.getItem());
}
});
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
e.getWindow().dispose();
}
});
}
public static void main(String[] args)
{
// TODO, add your application code
System.out.println("Hello World!");
TestChoice mainFrame=new TestChoice();
mainFrame.setTitle("TestChoice");
mainFrame.setBounds(300,200,200,100);
mainFrame.setVisible(true);
}
}