Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4063193

Exception at JDocument.positionToLine() with JDK1.1.3 + Swing-0.2

XMLWordPrintable

    • sparc
    • solaris_2.5.1

      When I clicked a button on the JTextComponent, I got NullPointerException.
      It happened with JDK1.1.3 + Swing-0.2. However, it worked fine with JDK1.1.2 + Swing-0.2.
      As a result of that, the program was stuck.

      To reproduce the bug:
      run Notepad( one of the Swing-0.2 examples ) with JDK1.1.3.

      Here is error message:
      Exception occurred during event dispatching:
      java.lang.NullPointerException
              at com.sun.java.swing.text.JDocument.positionToLine(JDocument.java:303)
              at com.sun.java.swing.text.JPlainView.modelToView(JPlainView.java:103)
              at com.sun.java.swing.text.JTextUI$JViewFactory.modelToView(JTextUI.java:379)
              at com.sun.java.swing.text.JTextUI$JTextView.modelToView(JTextUI.java:621)
              at com.sun.java.swing.text.JTextUI.modelToView(JTextUI.java:217)
              at com.sun.java.swing.text.JInsertPosition.changeCaretPosition(JInsertPosition.java:351)
              at com.sun.java.swing.text.JInsertPosition.setDot(JInsertPosition.java:304)
              at com.sun.java.swing.text.JInsertPosition.removeUpdate(JInsertPosition.java:182)
              at com.sun.java.swing.text.JDocument.externalNotifyRemove(JDocument.java:506)
              at com.sun.java.swing.text.JDocument.remove(JDocument.java:135)
              at com.sun.java.swing.text.JDocument.remove(JDocument.java:116)
              at com.sun.java.swing.text.JTextComponent.replaceSelection(JTextComponen
      t.java:161)
              at com.sun.java.swing.text.JTextComponent$InsertContentAction.actionPerf
      ormed(JTextComponent.java:570)
              at com.sun.java.swing.text.JTextController.mapEventToAction(JTextControl
      ler.java:216)
              at com.sun.java.swing.text.JTextController.keyPressed(JTextController.ja
      va:332)
              at java.awt.Component.processKeyEvent(Component.java:1872)
              at com.sun.java.swing.JComponent.processKeyEvent(JComponent.java:531)
              at java.awt.Component.processEvent(Component.java:1787)
              at java.awt.Container.processEvent(Container.java:792)
              at java.awt.Component.dispatchEventImpl(Component.java:1456)
              at java.awt.Container.dispatchEventImpl(Container.java:837)
              at java.awt.Component.dispatchEvent(Component.java:1393)
              at java.awt.LightweightDispatcher.processKeyEvent(Container.java:1288)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1274)
              at java.awt.Container.dispatchEventImpl(Container.java:824)
              at java.awt.Window.dispatchEventImpl(Window.java:401)
              at java.awt.Component.dispatchEvent(Component.java:1393)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)

              

            tprinzing Tim Prinzing
            bkimsunw Bae-chul Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: