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

Text disappears and reappears with certain fonts in JTextComponents (LINUX)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • client-libs
    • 2d
    • x86
    • linux

      FULL PRODUCT VERSION :
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Linux gaz 2.4.18 #18 SMP Mon Feb 24 11:42:05 EST 2003 i686 unknown


      A DESCRIPTION OF THE PROBLEM :
      Our text components have been experiencing random instances of text that disappears in the window. The text will appear/disappear as text is selected. The problem seems worse with larger font sizes (the larger the font, the more likely you are to see this bug). We have seen it with the 1.4.2 VM as well as the 1.5 VM. We have seen this in a JEditorPane and in a JTextArea.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile the code with this report and run it.
      Scroll to the bottom of the text area where you see the text "c =".
      Select text in the window (esp around the area where you see (or maybe you won't be able to see it) text that says "a: 'a'".
      Text will disappear and reappear as you select around in the window. You do not always have to select text for it to be invisible (bug is not selection dependent, that is just the way to see the bug).

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect that text will never disappear.
      ACTUAL -
      Text disappears as you select text in the window and reappears.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.Font;

      public class TestTextArea {

          public TestTextArea()
          {
              JFrame frame = new JFrame("Text Area");
              JTextArea textArea = new JTextArea();
              textArea.setLineWrap(false);
              textArea.setText("Warning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\toolbox\\images\\dicom.\n" +
                      "Warning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\toolbox\\stw\\dependencies\\hds2.\n" +
                      "Warning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\toolbox\\des\\desdemos.\n" +
                      "Warning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools.\n" +
                      "Warning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\compilertools.\n" +
                      "Warning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\autopilot." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\slrtw." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\slrtw\\dastudio." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\etargets." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\testomatic." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\toolbox\\stateflow." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\dsptools." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\hwtools." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\pm." +
                      "\nWarning: Name is nonexistent or not a directory: D:\\Work\\Ami\\matlab\\test\\tools\\stm." +
                      "\n" +
                      "\n To get started, select MATLAB Help or Demos from the Help menu." +
                      "\n" +
                      "\n>> c = struct('a', 'a', 'A12345', 'b', 'c', 'astring')" +
                      "\n" +
                      "\nc = " +
                      "\n" +
                      "\n a: 'a'" +
                      "\n A12345: 'b'" +
                      "\n c: 'astring'" +
                      "\n" +
                      "\n>> d" +
                      "\n??? Undefined function or variable 'd'." +
                      "\n" +
                      "\n>> d" +
                      "\n");
              textArea.getAccessibleContext().setAccessibleName("foo");
              textArea.setDragEnabled(true);
              textArea.setFont(new Font("Monospaced", Font.PLAIN, 60));
              JScrollPane sp = new JScrollPane(textArea);
              frame.getContentPane().add(sp);
              frame.getAccessibleContext().setAccessibleName("the frame");
              frame.setSize(1000,1000);
              frame.setLocation(300,300);
              frame.setVisible(true);

          }

          public static void main(String[] args)
          {
              new TestTextArea();
          }


      }
      ---------- END SOURCE ----------
      ###@###.### 2005-04-07 18:15:46 GMT

            prr Philip Race
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: