import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class FirstApplet extends Applet implements ItemListener {
String msg="";
Checkbox win98,winNT,Linux,mac;
public void init() {
setLayout(new FlowLayout(FlowLayout.LEFT));
win98=new Checkbox("Win98",null,true);
winNT=new Checkbox("WinNT/2000");
Linux=new Checkbox("Linux/Unix");
add(win98);
add(winNT);
add(Linux);
win98.addItemListener(this);
winNT.addItemListener(this);
Linux.addItemListener(this);
}
public void itmeStateChanged(ItemEvent ie){
repaint();
}
public void paint(Graphics g) {
msg="currnt state:";
g.drawString(msg, 6, 80 );
msg="win98:"+ win98.getState();
g.drawString(msg,6,100);
msg="winNT:"+ winNT.getState();
g.drawString(msg,6,120);
msg="Linux:"+ Linux.getState();
g.drawString(msg,6,140);
}
}
这个小程序在编译的时候提示说:“FirstApplet不是抽象的,并未覆盖 ItemListener中的方法“ 到底什么才是抽象的呢?应该怎么改?