我对 Synthetica 2.17/SyntheticaAddons 1.8.1 和 JXDatePicker/JXMonthView 有疑问。
我在下面给出了代码和异常。
程序代码:
import javax.swing.UIManager;
import org.jdesktop.swingx.JXDatePicker;
import de.javasoft.plaf.synthetica.SyntheticaBlackEyeLookAndFeel;
public class test1 {
public static void main(String[] args) {
try
{
UIManager.setLookAndFeel(new SyntheticaBlackEyeLookAndFeel());
}
catch (Exception e)
{
e.printStackTrace();
}
JXDatePicker from = new JXDatePicker();
}
}
例外:
Exception in thread "main" java.lang.ClassCastException: sun.swing.ImageIconUIResource cannot be cast to java.lang.String
at de.javasoft.plaf.synthetica.SyntheticaLookAndFeel.getString(SyntheticaLookAndFeel.java:2153)
at de.javasoft.plaf.synthetica.SyntheticaLookAndFeel.loadIcon(SyntheticaLookAndFeel.java:1868)
at de.javasoft.plaf.synthetica.SyntheticaLookAndFeel.loadIcon(SyntheticaLookAndFeel.java:1854)
at de.javasoft.plaf.synthetica.MonthViewUI.installDelegate(MonthViewUI.java:148)
at de.javasoft.plaf.synthetica.MonthViewUI.installDefaults(MonthViewUI.java:75)
at org.jdesktop.swingx.plaf.basic.BasicMonthViewUI.installUI(BasicMonthViewUI.java:252)
at de.javasoft.plaf.synthetica.MonthViewUI.installUI(MonthViewUI.java:85)
at javax.swing.JComponent.setUI(Unknown Source)
at org.jdesktop.swingx.JXMonthView.setUI(JXMonthView.java:779)
at org.jdesktop.swingx.JXMonthView.updateUI(JXMonthView.java:789)
at org.jdesktop.swingx.JXMonthView.<init>(JXMonthView.java:320)
at org.jdesktop.swingx.JXMonthView.<init>(JXMonthView.java:257)
at org.jdesktop.swingx.JXDatePicker.initMonthView(JXDatePicker.java:361)
at org.jdesktop.swingx.JXDatePicker.init(JXDatePicker.java:353)
at org.jdesktop.swingx.JXDatePicker.<init>(JXDatePicker.java:281)
at org.jdesktop.swingx.JXDatePicker.<init>(JXDatePicker.java:232)
at test1.main(test1.java:29)
我究竟做错了什么?
谢谢