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

New lines have underscores when the underline style is used in formatting

XMLWordPrintable

    • swing1.1
    • x86
    • windows_nt

      ==========================================================================
      carlos.lucasius@canada 1998-03-19:
      Bug reported by Corel (licensee) for JFC1.1 using JDK1.1.4 on WINNT4.0.
      Corel: "Very critical bug for our product - requires immediate attention."

      a. Setup to use the underline style for text formatting
      b. Enter text
      c. Press <enter> twice to create a couple of blank lines
      d. Enter text again
      f. Note that there are underscores characters left in the blank lines.

      ==========================================================================
      carlos.lucasius@canada 1998-03-26:

      Further to my request to Corel for more info (a test case), Corel responded
      with the following fix to the problem (changed code is underlined):

      In the file LabelView.java:

      final void paintText(Graphics g, Shape a, int p0, int p1) {
          Rectangle alloc = a.getBounds();
          sync();
          loadText(p0, p1);
          int y = alloc.y + alloc.height - metrics.getDescent();
          g.setFont(font);
          g.setColor(fg);
          Utilities.drawTabbedText(text, alloc.x, y, g, expander, p0);
          if (underline && text != null && !text.toString().equals("\n")) {
              y += 1; //------------------------------------------------
              g.drawLine(alloc.x, y, alloc.x + alloc.width, y);
          }
      }

            tprinzing Tim Prinzing (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: