import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class showChoice extends Applet implements
ItemListener{
private Choice names;
private TextField tf;
String s;
public void init()
{
names=new Choice ();
names.add("Giorgos");
names.add("Kwstas");
names.add("Giannis");
names.add("Dimitra");
names.add("Balia");
add(names);
names.addItemListener(this);
tf=new TextField(names.getItem(0),20);
tf.setEditable(false);
add(tf);
}
public void itemStateChanged(ItemEvent e)
{
s=(String) e.getItem();
tf.setText(s);
}
}
Thursday, July 16, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment