Exception in thread “AWT-EventQueue-0“ java.lang.NullPointerException

下午还好好的,晚上也不知道怎么操作的就给我,抛出了这么多的异常,找了一晚上不知道什么那里出错了!说是存在空指针,but还是没有找到空指针在哪?一气之下全都删了!!!重写!编程真是门玄学,说到底还是经验不足,寻寻觅觅终于发现了
还给我提示了说再说这存在空指针,眼瞎看不见

if("系统管理员".equals(MainFrm.userType.getName())){

在这个地方userType在此类中没有定义变量,导致userType为空,抛出异常。

	public static  userType userType;
	public static Object userObject;

加上就好了!!!!!!!!!!!!!!!!
Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
at com.tidl.view.EditPasswordFrm.submitEdit(EditPasswordFrm.java:157)
at com.tidl.view.EditPasswordFrm 2. a c t i o n P e r f o r m e d ( E d i t P a s s w o r d F r m . j a v a : 60 ) a t j a v a x . s w i n g . A b s t r a c t B u t t o n . f i r e A c t i o n P e r f o r m e d ( U n k n o w n S o u r c e ) a t j a v a x . s w i n g . A b s t r a c t B u t t o n 2.actionPerformed(EditPasswordFrm.java:60) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton 2.actionPerformed(EditPasswordFrm.java:60)atjavax.swing.AbstractButton.fireActionPerformed(UnknownSource)atjavax.swing.AbstractButtonHandler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue 3. r u n ( U n k n o w n S o u r c e ) a t j a v a . s e c u r i t y . A c c e s s C o n t r o l l e r . d o P r i v i l e g e d ( N a t i v e M e t h o d ) a t j a v a . s e c u r i t y . P r o t e c t i o n D o m a i n 3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain 3.run(UnknownSource)atjava.security.AccessController.doPrivileged(NativeMethod)atjava.security.ProtectionDomainJavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue 4. r u n ( U n k n o w n S o u r c e ) a t j a v a . s e c u r i t y . A c c e s s C o n t r o l l e r . d o P r i v i l e g e d ( N a t i v e M e t h o d ) a t j a v a . s e c u r i t y . P r o t e c t i o n D o m a i n 4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain 4.run(UnknownSource)atjava.security.AccessController.doPrivileged(NativeMethod)atjava.security.ProtectionDomainJavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值