import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class appletilk extends Applet implements ActionListener {
Choice ch;
List ls;
Button btEkle;
public void init() {
ch = new Choice();
for (int i=0; i<10; i++)
ch.add("item " + i);
ch.add("deneme");
ch.add("bagkur");
add(ch);
btEkle = new Button("ekle");
add(btEkle);
btEkle.addActionListener(this);
Button btSil = new Button("sil");
add(btSil);
btSil.addActionListener(new MySilListener());
ls = new List();
add(ls);
}
public void actionPerformed(ActionEvent ae) {
ls.add(ch.getSelectedItem());
}
class MySilListener implements ActionListener {
public void actionPerformed(ActionEvent ae) {
if (ls.getItemCount()>0 && ls.getSelectedIndex()>=0)
ls.remove(ls.getSelectedIndex());
}
}
}