我有 2 个 Java 类:
public abstract class IconNames {
/**
*
*/
public static final String ButtonFett = java.util.ResourceBundle.getBundle("recources/buttonproperties").getString("fett");
}
和
public class EditorPanelActionListener implements ActionListener{
.
.
.
String buttonText = e.getActionCommand();
switch(buttonText)
{
case IconNames.ButtonFett: //Error: constant string expression required
replace(XmlTags.BOLD);
break;
}
.
.
.
}
EditorPanelActionListener 触发错误“需要常量字符串表达式”,这是什么问题?
谢谢!