POLITECHNIKA RZESZOWSKA - Wydział Elektrotechnfti I Informatyki
import j ava.awt.* ; import j ava.awt.event.*;
public class ItemListenerTest extends Frame { ItemListenerTest() {
super("ItemListenerTest");
Checkbox cb = new Checkbox("Check Box"); cb.addltemListener( new ItemListener(){
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() = ItemEvent.SELECTED) { System.out.println{"SELECTED") ;
) else if (e.getStateChange()=ItemEvent.DESELECTED) System.out.println("DESELECTED"); }
add(cb);
setSize (300, 150); setVisible(true);
public static void main(String[J args) (new ItemListenerTest(); }