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