代码错误
问题如图,帮忙改正其错误{:10_247:} 复制粘贴比发图片更难吗? 乐乐学编程 发表于 2020-11-5 23:52复制粘贴比发图片更难吗?
package jsq;
public class jsq {
public static void main(String[] args) {
WindowActionEvent win = new WindowActionEvent();
win.setTitle("处理ActionEvent事件");
win.setBounds(100,100,310,260);
}
}
import java.awt.event.*;
public abstractclass ReaderListen implements ActionListener {
public void actionPerforemed(ActionEvent e) {
String str = e.getActionCommand();
System.out.println(str+":"+str.length());
}
}
package jsq;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class WindowActionEvent extends JFrame{
JTextField text;
ActionListener listener;
public WindowActionEvent() {
setLayout(new FlowLayout());
text = new JTextField(10);
add(text);
listener = (ActionListener) new ReaderListen();
text.addActionListener(listener);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
ReadListen类里的内部类重名了
页:
[1]