import java.awt.*;
import java.awt.event.*;
public class bbb
{
public static void main(String argc[])
{
new AppFrame();
}
} class AppFrame extends Frame implements ActionListener
{
TextField in=new TextField(6);
Button btn=new Button("ok");
Label out=new Label(" ");
public AppFrame()
{
setLayout(new FlowLayout());
add(in);
add(btn);
add(out);
setSize(400,400);
show();
btn.addActionListener(this);
}
public void actionperformed(ActionEvent e)
{
String s=in.getText();
Double n=Double.parseDouble(s);
Double qq=n*n*n;
out.setText("wo ri"+qq);
}
} 编译时出现错误
---------------------------------------
bbb.java:11: AppFrame 不是抽象的,并且未覆盖 java.awt.eve
抽象方法 actionPerformed(java.awt.event.ActionEvent)
class AppFrame extends Frame implements ActionListener 注意:bbb.java 使用或覆盖了已过时的 API。
注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
--------------------------------------
高手帮忙解决啊
import java.awt.event.*;
public class bbb
{
public static void main(String argc[])
{
new AppFrame();
}
} class AppFrame extends Frame implements ActionListener
{
TextField in=new TextField(6);
Button btn=new Button("ok");
Label out=new Label(" ");
public AppFrame()
{
setLayout(new FlowLayout());
add(in);
add(btn);
add(out);
setSize(400,400);
show();
btn.addActionListener(this);
}
public void actionperformed(ActionEvent e)
{
String s=in.getText();
Double n=Double.parseDouble(s);
Double qq=n*n*n;
out.setText("wo ri"+qq);
}
} 编译时出现错误
---------------------------------------
bbb.java:11: AppFrame 不是抽象的,并且未覆盖 java.awt.eve
抽象方法 actionPerformed(java.awt.event.ActionEvent)
class AppFrame extends Frame implements ActionListener 注意:bbb.java 使用或覆盖了已过时的 API。
注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
--------------------------------------
高手帮忙解决啊
public void actionPerformed(ActionEvent e) {
}我这个对的
--------------------------------注意:bbb.java 使用或覆盖了已过时的 API。
注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
----------------------------------------
import java.awt.event.*;
public class bbb
{
public static void main(String argc[])
{
new AppFrame();
}
} class AppFrame extends Frame implements ActionListener
{
TextField in=new TextField(6);
Button btn=new Button("ok");
Label out=new Label(" ");
public AppFrame()
{
setLayout(new FlowLayout());
add(in);
add(btn);
add(out);
setSize(400,400);
//show();
setVisible(true);
btn.addActionListener(this);
}
public void actionperformed(ActionEvent e)
{
String s=in.getText();
Double n=Double.parseDouble(s);
Double qq=n*n*n;
out.setText("wo ri"+qq);
}
}