JXDatePicker在创建新对象时抛出空指针异常

时间:2014-12-01 21:20:39

标签: java swing nullpointerexception

我一直在尝试使用以下行添加JXDatePicker

    JXDatePicker dobPicker = new JXDatePicker(new Date());

但是我得到了这个空指针异常

 java.lang.NullPointerException
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:1026)
    at org.jdesktop.swingx.plaf.UIManagerExt$UIDefaultsExt.getResourceCache(UIManagerExt.java:160)
    at org.jdesktop.swingx.plaf.UIManagerExt$UIDefaultsExt.getFromResourceBundle(UIManagerExt.java:144)
    at org.jdesktop.swingx.plaf.UIManagerExt$UIDefaultsExt.access$000(UIManagerExt.java:113)
    at org.jdesktop.swingx.plaf.UIManagerExt.getColor(UIManagerExt.java:427)
    at org.jdesktop.swingx.plaf.UIManagerExt.getColor(UIManagerExt.java:401)
    at org.jdesktop.swingx.plaf.basic.BasicMonthViewUI.installDefaults(BasicMonthViewUI.java:320)
    at org.jdesktop.swingx.plaf.basic.BasicMonthViewUI.installUI(BasicMonthViewUI.java:264)
    at javax.swing.JComponent.setUI(JComponent.java:664)
    at org.jdesktop.swingx.JXMonthView.setUI(JXMonthView.java:776)
    at org.jdesktop.swingx.JXMonthView.updateUI(JXMonthView.java:786)
    at org.jdesktop.swingx.JXMonthView.<init>(JXMonthView.java:318)
    at org.jdesktop.swingx.JXMonthView.<init>(JXMonthView.java:255)
    at org.jdesktop.swingx.JXDatePicker.initMonthView(JXDatePicker.java:359)
    at org.jdesktop.swingx.JXDatePicker.init(JXDatePicker.java:351)
    at org.jdesktop.swingx.JXDatePicker.<init>(JXDatePicker.java:279)
    at org.jdesktop.swingx.JXDatePicker.<init>(JXDatePicker.java:247)

我已经导入了所有类,其他组件都很好,我做错了吗?

0 个答案:

没有答案