import java.awt.event.*;//import java.util.*;import java.awt.*;import java.io.*; public class Testextends java.applet.Applet ItemListener{ static Frame f = new Frame(); List list = new List(6,false); public Test() { f.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent event) { setVisible(false); f.dispose(); System.exit(0); } }); } public void init() { setBackground(Color.white); setBounds(0,0,600,400); setLayout(null); Panel panel = new Panel(); Oberflaeche(panel); panel.setBounds(0,0,600,400); add(panel); validate(); } private void Oberflaeche(Panel panel) { list.addActionListener(this); list.addItemListener(this); list.add("Äpfel"); list.add("Birnen"); list.add("Bananen"); list.add("Pfirsiche"); list.add("Kirschen"); list.add("Kiwis"); list.add("Ananas"); list.add("Erdbeeren"); list.add("Blaubeeren"); list.add("Mandarinen"); panel.add(list); list.select(1); } public void itemStateChanged(ItemEvent event) { Checkbox cb = (Checkbox) event.getItemSelectable(); System.out.println(cb.getLabel() + ": " + cb.getState()); } public static void main( String argv[] ) { } //end of main() } // end of class