源程序:
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 errorProcess completed.
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 errorProcess completed.
解决方案 »
- 如何判断List<String> list中是否包含某个字符串呢?
- 请高手详谈java模式及j2ee模式
- java.lang.Process.exec(cmd)执行linux命令,程序如何与命令行交互?
- 针对按钮实现跳转页面的问题?
- 最近装了JAVA 3D 导入以后出了点问题
- 如何用RunTime.getRunTime.exec()来打开一个excel文件(c:\\demo.xls)
- 弱智问题,跪请解答。立答立解
- 类似delphi 可以用控件迁入一个浏览器,java有没有这样的控件呢?
- JBuilder 7特征!!!
- 初级问题,急呀!!!
- 怎么实现可变变量?
- fresher 求助 这是《JAVA2应用开发指南》上的例程 5-5
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
}
}