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

JEditorPane can't display enormous html paragraph

XMLWordPrintable

      I have test html page whose size is 45K. I tried to read it with JEditorPane and I got the following. I attached the test.html.

      To reproduce, simplely switch packages.html and test.html and run SwingSet demo.
      and click HTML pane.

      java.lang.StringIndexOutOfBoundsException: String index out of range: -21521
              at java.lang.String.<init>(String.java:150)
              at com.sun.java.swing.text.Segment.toString(Segment.java:79)
              at com.sun.java.swing.text.LabelView.sync(LabelView.java:367)
              at com.sun.java.swing.text.LabelView.getPreferredSpan(LabelView.java:112
      )
              at com.sun.java.swing.text.BoxView.calculateAlignedSizeRequirements(BoxV
      iew.java:609)
              at com.sun.java.swing.text.BoxView.checkRequests(BoxView.java:572)
              at com.sun.java.swing.text.BoxView.getPreferredSpan(BoxView.java:250)
              at com.sun.java.swing.text.ParagraphView.getPreferredSpan(ParagraphView.
      java:103)
              at com.sun.java.swing.text.BoxView.calculateAlignedSizeRequirements(BoxV
      iew.java:609)
              at com.sun.java.swing.text.BoxView.checkRequests(BoxView.java:572)
              at com.sun.java.swing.text.BoxView.getPreferredSpan(BoxView.java:250)
              at com.sun.java.swing.text.DefaultTextUI$RootView.getPreferredSpan(Defau
      ltTextUI.java:700)
              at com.sun.java.swing.text.DefaultTextUI.getPreferredSize(DefaultTextUI.
      java:469)
              at com.sun.java.swing.JComponent.getPreferredSize(JComponent.java:654)
              at com.sun.java.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.
      java:502)
              at com.sun.java.swing.basic.BasicScrollPaneUI$BasicScrollPaneLayout.layo
      utContainer(BasicScrollPaneUI.java:375)
              at java.awt.Container.layout(Container.java:462)
              at java.awt.Container.doLayout(Container.java:452)
              at java.awt.Container.validateTree(Container.java:523)
              at java.awt.Container.validateTree(Container.java:530)
              at java.awt.Container.validate(Container.java:505)
              at com.sun.java.swing.basic.BasicTabbedPaneUI.layoutContainer(BasicTabbe
      dPaneUI.java:585)
              at java.awt.Container.layout(Container.java:462)
              at java.awt.Container.doLayout(Container.java:452)
              at com.sun.java.swing.basic.BasicTabbedPaneUI.stateChanged(BasicTabbedPa
      neUI.java:624)
              at com.sun.java.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:179)

              at com.sun.java.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane
      .java:123)
              at com.sun.java.swing.DefaultSingleSelectionModel.fireStateChanged(Defau
      ltSingleSelectionModel.java:96)
              at com.sun.java.swing.DefaultSingleSelectionModel.setSelectedIndex(Defau
      ltSingleSelectionModel.java:50)
              at com.sun.java.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:219)

              at com.sun.java.swing.basic.BasicTabbedPaneUI$MouseGetter.mousePressed(B
      asicTabbedPaneUI.java:915)
              at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:21
      9)
              at java.awt.Component.processMouseEvent(Component.java:2504)
              at java.awt.Component.processEvent(Component.java:2350)
              at java.awt.Container.processEvent(Container.java:889)
              at java.awt.Component.dispatchEventImpl(Component.java:1916)
              at java.awt.Container.dispatchEventImpl(Container.java:934)
              at java.awt.Component.dispatchEvent(Component.java:1826)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:1541
      )
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:1446)

              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1382)
              at java.awt.Container.dispatchEventImpl(Container.java:921)
              at java.awt.Window.dispatchEventImpl(Window.java:517)
              at java.awt.Component.dispatchEvent(Component.java:1826)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:160)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:45)

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: