事件监听处理问题,求教

qiuyuecd 2005-05-17 01:52:16
在编译时提示:(不知为何????)
E:\MyPractice\myjava\scr\ExchangeFrameByAction.java:111: myclass.ButtonActionListener is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
class ButtonActionListener implements ActionListener{
^
E:\MyPractice\myjava\scr\ExchangeFrameByAction.java:125: cannot resolve symbol
symbol : class currentCommand
location: class myclass.ButtonActionListener
if ((currentCommand) equals( FrameOne.getWeatherBtn))



这段程序是这样写的(暂没用MVC,使用的是static var方式来处理)
//处理按钮监听事件
class ButtonActionListener implements ActionListener{

public JButton currentButton;
public String currentCommand;

public ButtonActionListener(JButton button){
currentButton = button;
}

public void actionPerformer(ActionEvent e){

currentCommand = e.getActionCommand();


if ((currentCommand) equals( FrameOne.getWeatherBtn))
ExchangeFrameByAction.frameTwo.show();

if ((currentCommand) equals (FrameTwo.getMessageBtn))
ExchangeFrameByAction.frameOne.show();

if ((currentCommand) equals (FrameOne.setWeatherBtn)){

FrameTwo.txtTwo.setText(FrameOne.txtOne.getText());
ExchangeFrameByAction.frameTwo.show();
}

if ((currentCommand) equals (FrameTwo.setMessageBtn)){
FrameOne.txtOne.setText(FrameTwo.txtTwo.getText());
ExchangeFrameByAction.frameOne.show();
}
}
}
...全文
16 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,612

社区成员

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

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