不定时的出现这个问题.烦死了.烦透了.用别人的东西不爽,但是为了美观又不得不用.老师出这个异常.Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
这个问题是什么引起的,原因是什么呢?真让人头痛!用了别人的外观
UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
有用Substance的吗?初步怀疑是这个外观jar包引起的,但是始终又找不到原因在哪里.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at javax.swing.KeyboardManager.registerMenuBar(Unknown Source)
at javax.swing.JMenuBar.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at org.jvnet.substance.utils.SubstanceTitlePane.addNotify(SubstanceTitlePane.java:822)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at javax.swing.JRootPane.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Frame.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at sun.awt.im.CompositionArea.<init>(Unknown Source)
at sun.awt.im.CompositionAreaHandler.createCompositionArea(Unknown Source)
at sun.awt.im.CompositionAreaHandler.inputMethodTextChanged(Unknown Source)
at sun.awt.im.CompositionAreaHandler.processInputMethodEvent(Unknown Source)
at sun.awt.im.InputMethodContext.dispatchEvent(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.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)如果这个问题不能解决希望大虾们能推荐个不出问题的外观jar包.
这个问题是什么引起的,原因是什么呢?真让人头痛!用了别人的外观
UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
有用Substance的吗?初步怀疑是这个外观jar包引起的,但是始终又找不到原因在哪里.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at javax.swing.KeyboardManager.registerMenuBar(Unknown Source)
at javax.swing.JMenuBar.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at org.jvnet.substance.utils.SubstanceTitlePane.addNotify(SubstanceTitlePane.java:822)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at javax.swing.JRootPane.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Frame.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at sun.awt.im.CompositionArea.<init>(Unknown Source)
at sun.awt.im.CompositionAreaHandler.createCompositionArea(Unknown Source)
at sun.awt.im.CompositionAreaHandler.inputMethodTextChanged(Unknown Source)
at sun.awt.im.CompositionAreaHandler.processInputMethodEvent(Unknown Source)
at sun.awt.im.InputMethodContext.dispatchEvent(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.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)如果这个问题不能解决希望大虾们能推荐个不出问题的外观jar包.
JFrame.setDefaultLookAndFeelDecorated(true);把这个注释了不用.
虽然问题解决了但是我还是不清楚到底是什么原因.
没当从英文输入法切换到中文输入法,只要一打字就出这个异常.
网上找了一晚上初步认为是几个JTextField的问题.
代码过多,贴不上来.也找不到错误代码在哪里啊.