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

REGRESSION: cursor and selected text incorrectly colored in TextField

    XMLWordPrintable

Details

    • b79
    • x86
    • linux

    Description

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


      ADDITIONAL OS VERSION INFORMATION :
      Linux 2.4.21-27.0.2.ELsmp #1 SMP Wed Jan 12 23:35:44 EST 2005 i686 i686 i386 GNU/Linux

      Red Hat Enterprise Linux WS release 3 (Taroon Update 5)

      A DESCRIPTION OF THE PROBLEM :
      The linux version of Java 5.0 incorrectly colors the cursor and selected text in a java.awt.TextField. The cursos color is always black and any selected text is colored white-on-black regardless of the foreground/background colors of the TextField.

      In Java 1.4.2 the cursor and highlight colors were always based on the foreground and background colors of the text area.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile the sample code
      2. Run the sample code and select the word "Hello" using the mouse
      3. Notice that the colors are wrong

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Coloring in Java 5.0 should match Java 1.4.2.
      ACTUAL -
      Cursor is always black and selected text is always white-on-black regardless of the foreground/background colors of the TextArea.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;

      public class Temp {
          public static void main(String[] args) {
      Frame frame = new Frame();
      TextField textField = new TextField("Hello");

      textField.setBackground(Color.black);
      textField.setForeground(Color.blue);

      frame.add(textField);
      frame.pack();
      frame.setVisible(true);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Use Java 1.4.2

      Release Regression From : 1.4.2
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.
      ###@###.### 2005-06-20 11:11:49 GMT

      Attachments

        Activity

          People

            osemenovsunw Oleg Semenov (Inactive)
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: