我调用了:
JFrame.setDefaultLookAndFeelDecorated(true);
之后,我在输入框JTextField中输入中文时就抛出好多异常: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 java.awt.Container.addImpl(Unknown Source)
        at javax.swing.JLayeredPane.addImpl(Unknown Source)
        at java.awt.Container.add(Unknown Source)
        at com.incors.plaf.alloy.AlloyRootPaneUI.addTitlePane(Unknown Source)
        at com.incors.plaf.alloy.AlloyRootPaneUI.installWindowDecoration(Unknown
 Source)
        at com.incors.plaf.alloy.AlloyRootPaneUI.propertyChange(Unknown Source)
        at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
        at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
        at java.awt.Component.firePropertyChange(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 Sourc
e)
        at sun.awt.im.CompositionAreaHandler.inputMethodTextChanged(Unknown Sour
ce)
        at sun.awt.im.CompositionAreaHandler.processInputMethodEvent(Unknown Sou
rce)
        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)大家有没有遇到这样的情况?
不知怎么解决?

解决方案 »

  1.   

    听说jdk1.4.2的版本没有问题。
    我用的是jdk1.5.004版的。
      

  2.   

    不会吧?
    楼上的朋友,你的1.5没问题?我以前用的是jdk1.5.0,发现问题后,又下载了最新的jdk1.5.004的,还是出现老问题.我的操作系统是windows xp的。
    不过我如果所界面样式换成windows模式的就没问题。在输入汉字的时候,输入法的那个JAVA自带的输入窗口显示不出来,应该是这样抛出了异常。
      

  3.   

    我 遇到过,不要用微软的比如智能ABC跟那个微软拼音2003什么的好象就不会
    很奇怪
      

  4.   

    我就没成功过一次。
    在另一台同事的电脑上测试也是一样。
    我用的五笔,同事用的是智能ABC伤脑筋啊...