注意:D:\ZK_Home\School\src\Addition.java 使用或覆盖了已过时的 API。
注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。请问现在action 被什么替换了。-------------------------
以下的代码运行时报错:import java.awt.*;
import java.applet.Applet;public class Addition extends Applet { Label prompt;
TextField input;
int number;
int sum; public void init() {
prompt = new Label("Enter integer and press Enter");
input = new TextField(10);
add(prompt);
add(input);
sum = 0; } public boolean action(Event e, Object o) {
number = Integer.parseInt(o.toString());
input.setText("");
sum = sum + number;
showStatus(Integer.toString(sum));
return true;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货