本文介绍了请帮我这个......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Netbeans IDE 7.0.1我设置JFrame的gridbaglayout它是通过exeption

以下

当我没有使用任何布局它工作正常... 。





线程中的异常  AWT-EventQueue-0 java.lang.NullPointerException 
at java.awt.GridBagConstraints.clone(GridBagConstraints.java: 652
at java.awt.GridBagLayout.setConstraints(GridBagLayout.java: 499
at java.awt .GridBagLayout.addLayoutComponent(GridBagLayout.java: 700
at java.awt.Container.addImpl(Container.java: 1120
at java.awt.Container.add(Container.java: 966
at Main_Menu.initComponents( Main_Menu.java: 143 )Main_Menu
。< init>(Main_Menu.java: 24
在Main_Menu $ 5.run(Main_Menu.java: 206
at java.awt.event.InvocationEvent.dispatch( InvocationEvent.java: 251
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java: 733
at java.awt.EventQueue.access $ 200(EventQueue.java: 103
at java.awt.EventQueue $ 3.run (EventQueue.java: 694
at java.awt.EventQueue $ 3.run(EventQueue.java: 692
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain $ 1.doIntersectionPrivilege(ProtectionDomain.java: 76
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 703
at java.awt.EventDispatchThread.pumpOneEventForFilters (EventDispatchThread.java: 242
at java.awt.EventDisp atchThread.pumpEventsForFilter(EventDispatchThread.java: 161
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java: 150
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 146
at java.awt.EventDispatchThread .pumpEvents(EventDispatchThread.java: 138
at java.awt.EventDispatchThread.run(EventDispatchThread.java: 91 )< / init>
解决方案




i am using Netbeans IDE 7.0.1 i set gridbaglayout of JFrame it is throughing exeption
below
when i did not use any layout it works fine....


Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at java.awt.GridBagConstraints.clone(GridBagConstraints.java:652)
	at java.awt.GridBagLayout.setConstraints(GridBagLayout.java:499)
	at java.awt.GridBagLayout.addLayoutComponent(GridBagLayout.java:700)
	at java.awt.Container.addImpl(Container.java:1120)
	at java.awt.Container.add(Container.java:966)
	at Main_Menu.initComponents(Main_Menu.java:143)
	at Main_Menu.<init>(Main_Menu.java:24)
	at Main_Menu$5.run(Main_Menu.java:206)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:694)
	at java.awt.EventQueue$3.run(EventQueue.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)</init>
解决方案




这篇关于请帮我这个......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 11:26