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

REGRESSION:TextArea.setBackground(color) fail if setEditable(false) in SDK 1.3.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • client-libs
    • x86
    • windows_nt



      Name: rmT116609 Date: 10/10/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      An application that has been running fine under SDK 1.2.2 lost all background
      color after upgrade to SDK 1.3.0. Found out it has to do with the .setEditable
      () method. Provide a simple code for demonstration, same code has been tested
      on our old machine with SDK 1.2.2 installed. If this is not a bug, please show
      work around. Thanks.

      ----------------------------
      import java.io.*;
      import java.awt.*;
      import java.awt.event.*;

      public class TAbgcolor {

         // just to make this simple
         public static void main(String args[]) {
            Frame testframe = new Frame("Test Frame");
            TextArea testTArea = new TextArea("",25,80,TextArea.SCROLLBARS_NONE);

            testframe.setBounds(100,100,0,0);
            testframe.setLayout(new BorderLayout());
            testframe.addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent winevt) {
                  System.exit(0);
               }
            });

            testTArea.setBackground(Color.white);
            testTArea.setForeground(Color.blue);
            testTArea.setEditable(false);

            testframe.add(testTArea);

            testframe.pack();
            testframe.setVisible(true);

            testTArea.append("\nI'm trying to set up a view only dispaly area\n");
            testTArea.append("with blue font on white background!\n\n");
            testTArea.append("This code run fine under SDK1.2.2, but not SDK1.3.0\n");
            testTArea.append("Is this a bug, or is there a workaround for it?\n");
         }
      }
      (Review ID: 110467)
      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: