当前位置: 技术问答>java相关
帮我看看这个异常是什么原因?
来源: 互联网 发布时间:2015-05-30
本文导语: C:JBuilder4jdk1.3binjavaw -classpath "D:JB-myProjectUIDesignerclasses;C:JBuilder4libjbcl.jar;C:JBuilder4jdk1.3jrelibi18n.jar;C:JBuilder4jdk1.3jrelibjaws.jar;C:JBuilder4jdk1.3jrelibrt.jar;C:JBuilder4jdk1.3jrelibsunrsasign.jar;C:JBuilder4jdk1.3libdt.jar;C:JBuilder4jdk1.3libtools.jar"...
C:JBuilder4jdk1.3binjavaw -classpath "D:JB-myProjectUIDesignerclasses;C:JBuilder4libjbcl.jar;C:JBuilder4jdk1.3jrelibi18n.jar;C:JBuilder4jdk1.3jrelibjaws.jar;C:JBuilder4jdk1.3jrelibrt.jar;C:JBuilder4jdk1.3jrelibsunrsasign.jar;C:JBuilder4jdk1.3libdt.jar;C:JBuilder4jdk1.3libtools.jar" uidesigner.UIDesigner
java.io.NotSerializableException: com.sun.java.swing.plaf.windows.WindowsFileChooserUI
Exception occurred during event dispatching:
java.lang.NullPointerException
at javax.swing.plaf.basic.BasicComboBoxUI.setPopupVisible(BasicComboBoxUI.java:897)
at javax.swing.JComboBox.setPopupVisible(JComboBox.java:609)
at javax.swing.JComboBox.hidePopup(JComboBox.java:602)
at javax.swing.JComboBox$1.ancestorRemoved(JComboBox.java:148)
at javax.swing.AncestorNotifier.fireAncestorRemoved(AncestorNotifier.java:89)
at javax.swing.AncestorNotifier.componentHidden(AncestorNotifier.java:186)
at java.awt.AWTEventMulticaster.componentHidden(AWTEventMulticaster.java:130)
at java.awt.AWTEventMulticaster.componentHidden(AWTEventMulticaster.java:130)
at java.awt.Component.processComponentEvent(Component.java:3609)
at java.awt.Component.processEvent(Component.java:3558)
at java.awt.Container.processEvent(Container.java:1164)
at java.awt.Window.processEvent(Window.java:777)
at java.awt.Component.dispatchEventImpl(Component.java:2595)
at java.awt.Container.dispatchEventImpl(Container.java:1213)
at java.awt.Window.dispatchEventImpl(Window.java:912)
at java.awt.Component.dispatchEvent(Component.java:2499)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
java.io.NotSerializableException: com.sun.java.swing.plaf.windows.WindowsFileChooserUI
Exception occurred during event dispatching:
java.lang.NullPointerException
at javax.swing.plaf.basic.BasicComboBoxUI.setPopupVisible(BasicComboBoxUI.java:897)
at javax.swing.JComboBox.setPopupVisible(JComboBox.java:609)
at javax.swing.JComboBox.hidePopup(JComboBox.java:602)
at javax.swing.JComboBox$1.ancestorRemoved(JComboBox.java:148)
at javax.swing.AncestorNotifier.fireAncestorRemoved(AncestorNotifier.java:89)
at javax.swing.AncestorNotifier.componentHidden(AncestorNotifier.java:186)
at java.awt.AWTEventMulticaster.componentHidden(AWTEventMulticaster.java:130)
at java.awt.AWTEventMulticaster.componentHidden(AWTEventMulticaster.java:130)
at java.awt.Component.processComponentEvent(Component.java:3609)
at java.awt.Component.processEvent(Component.java:3558)
at java.awt.Container.processEvent(Container.java:1164)
at java.awt.Window.processEvent(Window.java:777)
at java.awt.Component.dispatchEventImpl(Component.java:2595)
at java.awt.Container.dispatchEventImpl(Container.java:1213)
at java.awt.Window.dispatchEventImpl(Window.java:912)
at java.awt.Component.dispatchEvent(Component.java:2499)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
|
java.lang.NullPointerException
应该是某个类型的变量没有得到赋值,即为null,而你却对它进行了判断等运算或者其它的处理,因而报错
比如String str;
此时没有赋值,你若int i = str.length()便会报这种错误。当然此时注意,null并不是等同于空值。即此处对String而言,null不同于"";
==============================
在下所说,也许并非正确,请从建议的角度批判地吸收!
应该是某个类型的变量没有得到赋值,即为null,而你却对它进行了判断等运算或者其它的处理,因而报错
比如String str;
此时没有赋值,你若int i = str.length()便会报这种错误。当然此时注意,null并不是等同于空值。即此处对String而言,null不同于"";
==============================
在下所说,也许并非正确,请从建议的角度批判地吸收!
|
java.lang.NullPointerException 字符串、数组、记录集等等没有初始化就被使用。。