Synthetica 2.17 / SyntheticaAddons 1.8.1和JXDatePicker / JXMonthView

时间:2013-05-15 17:01:49

标签: java synthetica

我对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)

我做错了什么?

由于

1 个答案:

答案 0 :(得分:0)

在classpath中添加syntheticaBlackEyeAddon.jar解决了问题。