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

setBackground() on Textarea/TextFields doesn't work (Win L&F)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.2.1
    • client-libs
    • x86
    • windows_nt



      Name: krT82822 Date: 07/01/99


      Calling setBackground(Color.lightGray) does not work.
      It set the background to white. This is not a problem with 1.1.7.

      -------------------

      kevin.ryan@eng -- verified, even with JDK 1.2.2 RC1. Thought we already had a bug re. this, but couldn't find it.

      import java.awt.*;

      public class blah extends Frame {

          public blah() {
              super();
              // couldn't get it to work without Swing-style semantics
              getContentPane().setLayout(new BorderLayout());

              TextArea ta = new TextArea();
              ta.setSize(200,200);
              ta.setBackground(Color.lightGray);
              ta.setForeground(Color.blue);
              ta.setText("This is the full extent of the text behind which we'd like to see a light Gray background.");

              getContentPane().add(ta, BorderLayout.CENTER);
              pack();
          }

          public static void main(String[] args) {
              blah f = new blah();
              f.setLocation(200, 200);
              f.setVisible(true);
          }
      }

      (Review ID: 85068)
      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: