有人吗?帮忙看看

kenanxiaoxiaohai 2006-07-29 10:12:37
源程序:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class ImplementActionListener extends Applet implements ActionListener
{
TextField password = new TextField("我是密码");
Button btn = new Button("隐藏");
public void init()
{
add(password);
add(btn);
btn.addActionListener(this);
}
public void actionPerform(ActionEvent e)
{
password.setEchoChar('*');
password.selectAll();
}
}
========================
错误提示:
--------------------Configuration: j2sdk1.4.0 <Default>--------------------
E:\javaexerces\ImplementActionListener.java:4: ImplementActionListener should be declared abstract; it does not define actionPerformed(java.awt.event.ActionEvent) in ImplementActionListener
public class ImplementActionListener extends Applet implements ActionListener
^
1 error

Process completed.

...全文
78 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
rcom10002 2006-07-29
  • 打赏
  • 举报
回复
import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class ImplementActionListener extends Applet implements ActionListener {
TextField password = new TextField("我是密码");

Button btn = new Button("隐藏");

public void init() {
add(password);
add(btn);
btn.addActionListener(this);
}

public void actionPerform(ActionEvent e) {
password.setEchoChar('*');
password.selectAll();
}

/* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub

}
}
kenanxiaoxiaohai 2006-07-29
  • 打赏
  • 举报
回复
没有人吗?
kenanxiaoxiaohai 2006-07-29
  • 打赏
  • 举报
回复
没人回,呜呜~~~~~~

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧