.\PoliceListen.java:3: 错误: PoliceListen不是抽象的, 并且未覆盖MyCommandListener中的
MyCommandListener.javaimportjavax.swing.*;importjava.awt.event.*;publicinterfaceMyCom...
MyCommandListener.java
import javax.swing.*;
import java.awt.event.*;
public interface MyCommandListener extends ActionListener{
public void setJTextField(JTextField text);
public void setJTextArea(JTextArea area);
}
PoliceListen.java
import java.awt.event.*;
import javax.swing.*;
public class PoliceListen implements MyCommandListener{
JTextField textInput;
JTextArea textShow;
public void setJextField(JTextField text){
textInput = text;
}
public void setJTextArea(JTextArea area){
textShow = area;
}
public void actionPerformed(ActionEvent e){
String str =textInput.getText();
textShow.append(str+"的长度"+str.length()+"\n");
}
}
我怎么觉得方法好像都实现了啊,求大神帮忙 展开
import javax.swing.*;
import java.awt.event.*;
public interface MyCommandListener extends ActionListener{
public void setJTextField(JTextField text);
public void setJTextArea(JTextArea area);
}
PoliceListen.java
import java.awt.event.*;
import javax.swing.*;
public class PoliceListen implements MyCommandListener{
JTextField textInput;
JTextArea textShow;
public void setJextField(JTextField text){
textInput = text;
}
public void setJTextArea(JTextArea area){
textShow = area;
}
public void actionPerformed(ActionEvent e){
String str =textInput.getText();
textShow.append(str+"的长度"+str.length()+"\n");
}
}
我怎么觉得方法好像都实现了啊,求大神帮忙 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询