Swing UI Frame被发现卡住并在java中显示灰色屏幕

时间:2012-09-13 12:01:26

标签: java swing jbutton layout-manager

我遇到问题就像在某个时候我运行我的应用程序它显示灰色屏幕而不是显示正确的UI和应用程序继续抛出异常。你能不能请任何人给我解决方案来解决这个问题。

  Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
     at javax.swing.plaf.basic.BasicButtonUI.getMinimumSize(Unknown Source)
     at javax.swing.JComponent.getMinimumSize(Unknown Source)
     at java.awt.BorderLayout.minimumLayoutSize(Unknown Source)
     at java.awt.Container.minimumSize(Unknown Source)
     at java.awt.Container.getMinimumSize(Unknown Source)
     at javax.swing.JComponent.getMinimumSize(Unknown Source)
     at java.awt.FlowLayout.minimumLayoutSize(Unknown Source)
     at java.awt.Container.minimumSize(Unknown Source)
     at java.awt.Container.getMinimumSize(Unknown Source)
     at javax.swing.JComponent.getMinimumSize(Unknown Source)
     at java.awt.GridBagLayout.GetLayoutInfo(Unknown Source)
     at java.awt.GridBagLayout.getLayoutInfo(Unknown Source)
     at java.awt.GridBagLayout.ArrangeGrid(Unknown Source)
     at java.awt.GridBagLayout.arrangeGrid(Unknown Source)
     at java.awt.GridBagLayout.layoutContainer(Unknown Source)
     at java.awt.Container.layout(Unknown Source)
     at java.awt.Container.doLayout(Unknown Source)
     at java.awt.Container.validateTree(Unknown Source)
     at java.awt.Container.validateTree(Unknown Source)
     at java.awt.Container.validateTree(Unknown Source)
     at java.awt.Container.validateTree(Unknown Source)
     at java.awt.Container.validateTree(Unknown Source)
     at java.awt.Container.validate(Unknown Source)
     at javax.swing.RepaintManager.validateInvalidComponents(Unknown Source)
     at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
     at java.awt.event.InvocationEvent.dispatch(Unknown Source)
     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
     at java.awt.EventQueue.access$000(Unknown Source)
     at java.awt.EventQueue$3.run(Unknown Source)
     at java.awt.EventQueue$3.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.ProtectionDomain$1.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)

1 个答案:

答案 0 :(得分:0)

逐个删除屏幕中的组件,直到出现问题。有了你qn中的信息,就不用多说了。