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

StringIndexOutOfBoundsException when drawing Japanese text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.2.0
    • client-libs
    • 2d
    • sparc
    • solaris_2.5.1

      Run SwingSet in ja locale. Go to Plain Text panel, click in large text area. Use input method to enter Japanese text. After you commit, the system indefinitely throws StringIndexOutOfBoundsExceptions.

      see
      http://javaweb.eng/~norbert/japanese/index.html
      on how to use Japanese input methods.

      Here's the exception info:
      java.lang.StringIndexOutOfBoundsException: String index out of range: -77
              at java.lang.String.charAt(String.java:392)
              at sun.io.ByteToCharEUC_JP.getUnicode(ByteToCharEUC_JP.java:72)
              at sun.io.ByteToCharEUC_JP.convert(ByteToCharEUC_JP.java:150)
              at java.lang.String.<init>(String.java:262)
              at java.lang.String.<init>(String.java:343)
              at java.awt.Font.getGlyphSet(Font.java:1323)
              at java.awt.Font.getGlyphSet(Font.java:1165)
              at java.awt.Font.getGlyphSet(Font.java:1352)
              at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:724)
              at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:730)
              at java.awt.swing.SwingGraphics.drawString(SwingGraphics.java:266)
              at java.awt.Graphics.drawChars(Graphics.java:786)
              at java.awt.swing.text.Utilities.drawTabbedText(Utilities.java:69)
              at java.awt.swing.text.PlainView.drawUnselectedText(PlainView.java:146)
              at java.awt.swing.text.PlainView.drawLine(PlainView.java:106)
              at java.awt.swing.text.PlainView.paint(PlainView.java:270)
              at java.awt.swing.text.DefaultTextUI$RootView.paint(DefaultTextUI.java:741)
              at java.awt.swing.text.DefaultTextUI.paintSafely(DefaultTextUI.java:335)
              at java.awt.swing.text.DefaultTextUI$SafePainter.run(DefaultTextUI.java:999)
              at java.awt.swing.text.AbstractDocument.render(AbstractDocument.java:244)
              at java.awt.swing.text.DefaultTextUI.paint(DefaultTextUI.java:442)
              at java.awt.swing.plaf.ComponentUI.update(ComponentUI.java:47)
              at java.awt.swing.JComponent.paintComponent(JComponent.java:371)
              at java.awt.swing.JComponent.paint(JComponent.java:576)
              at java.awt.swing.JComponent.paintChildren(JComponent.java:431)
              at java.awt.swing.JComponent.paint(JComponent.java:579)
              at java.awt.swing.JViewport.paint(JViewport.java:266)
              at java.awt.swing.JComponent.paintWithBuffer(JComponent.java:3074)
              at java.awt.swing.JComponent._paintImmediately(JComponent.java:3037)
              at java.awt.swing.JComponent.paintImmediately(JComponent.java:2952)
              at java.awt.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:292)
              at java.awt.swing.RepaintManager.repaintDirtyRegions(RepaintManager.java:224)
              at java.awt.swing.RepaintManager$RepaintListener.actionPerformed(RepaintManager.java:452)
              at java.awt.swing.Timer.fireActionPerformed(Timer.java:124)
              at java.awt.swing.Timer$DummyComponent.processEvent(Timer.java:309)
              at java.awt.Component.dispatchEventImpl(Component.java:1917)
              at java.awt.Component.dispatchEvent(Component.java:1827)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:160)

            jkaulorcl Jeet Kaul (Inactive)
            nlindenbsunw Norbert Lindenberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: