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

REGRESSION: NPE when using SwingTextField

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: fx1.2
    • Fix Version/s: fx1.2
    • Component/s: javafx
    • Labels:
      None

      Description

      If you run the test program attached to RT-3633 on the latest Marina build, you will get an NPE in SwingTextField:

      javafxc MainWithHLayout

      Exception in trigger:
      java.lang.NullPointerException
      at javax.swing.text.Utilities.getTabbedTextWidth(Utilities.java:256)
      at javax.swing.text.Utilities.getTabbedTextWidth(Utilities.java:191)
      at javax.swing.text.PlainView.getLineWidth(PlainView.java:643)
      at javax.swing.text.PlainView.updateDamage(PlainView.java:541)
      at javax.swing.text.PlainView.insertUpdate(PlainView.java:425)
      at javax.swing.text.FieldView.insertUpdate(FieldView.java:276)
      at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1590)
      at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1849)
      at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:185)
      at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:734)
      at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:693)
      at javax.swing.text.PlainDocument.insertString(PlainDocument.java:114)
      at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:655)
      at javax.swing.text.JTextComponent.setText(JTextComponent.java:1693)
      at javafx.ext.swing.SwingTextField$1$1.lambda(SwingTextField.fx:65)
      at javafx.ext.swing.SwingTextField$1$1.invoke(SwingTextField.fx:64)
      at javafx.ext.swing.SwingTextField$1$1.invoke(SwingTextField.fx:64)
      at javafx.ext.swing.SwingComponent.doAndIgnoreJComponentChange(SwingComponent.fx:186)
      at javafx.ext.swing.SwingTextField$1.onChange(SwingTextField.fx:64)
      at javafx.ext.swing.SwingTextField$1.onChange(SwingTextField.fx:62)
      at com.sun.javafx.runtime.location.ObjectVariable$2.onAction(ObjectVariable.java:141)
      at com.sun.javafx.runtime.location.ObjectVariable$2.onAction(ObjectVariable.java:138)
      at com.sun.javafx.runtime.location.DependencyIterator.action(AbstractLocation.java:539)
      at com.sun.javafx.runtime.location.DependencyIterator.action(AbstractLocation.java:527)
      at com.sun.javafx.runtime.util.Linkables.iterate(Linkables.java:82)
      at com.sun.javafx.runtime.location.AbstractLocation.iterateChildren(AbstractLocation.java:282)
      at com.sun.javafx.runtime.location.ObjectVariable.notifyListeners(ObjectVariable.java:138)
      at com.sun.javafx.runtime.location.ObjectVariable.replaceValue(ObjectVariable.java:104)
      at com.sun.javafx.runtime.location.ObjectVariable.set(ObjectVariable.java:115)
      at com.sun.javafx.runtime.location.AbstractVariable$4.apply(AbstractVariable.java:132)
      at com.sun.javafx.runtime.location.AbstractVariable.needDefault(AbstractVariable.java:151)
      at javafx.ext.swing.SwingTextField.initialize$(SwingTextField.fx:62)
      at MainWithHLayout.getGrid(MainWithHLayout.fx:38)
      at MainWithHLayout.javafx$run$(MainWithHLayout.fx:20)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.javafx.runtime.provider.GUIRuntimeProvider$1.run(GUIRuntimeProvider.java:65)
      at com.sun.javafx.tk.swing.SwingToolkit$StartupRoutine.run(SwingToolkit.fx:481)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

        Attachments

          Activity

            People

            Assignee:
            idk Igor Kushnirskiy (Inactive)
            Reporter:
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: