String.ActionListener 这是什么写法

来源:百度知道 编辑:UC知道 时间:2024/06/05 08:44:25
我把公司以前的一个GUI的项目反编译了一下,由于源代码丢失。
出现以下语句,叫我无法理解,我已排除反编译时出错,原来肯定就是这样写的,但语法报错
public PopupAction(String compName, String menuName)
{
super(menuName);
setFont(new Font("\u5B8B\u4F53", 0, 12));
String menuItemValue = menuName;
final String compID = compName;
addActionListener(menuItemValue. new ActionListener() {

public void actionPerformed(ActionEvent e)
{
inner_popup_actionPerformed(e, compID, menuItemValue);
}

});
}
就是这句话报错addActionListener(menuItemValue. new ActionListener
错误信息:String.ActionLIstener connot bu resolvde to a type
是这么写的啊new ActionListener()

String.ActionLIstener connot bu resolvde to a type
的意思就是ActionListener 不是一种类型.肯定是你的ActionListener 的包没有导如.检查一下,导如.OK!
ActionLIstener 你是这样写的吗?如果是导了包,这样写的话就是I要小写,你是大写的.