0

我遇到了一些问题,例如当我运行我的应用程序时,它显示灰屏,而不是显示正确的 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)
4

1 回答 1

0

一个一个地删除屏幕中的组件,直到问题消失。有了你 qn 中的信息,就没有什么可说的了。

于 2012-09-13T19:00:47.010 回答