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

[TextArea] TextArea background cannot be changed

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 8
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:
      None

      Description

      https://bugs.openjdk.java.net/browse/JDK-8036924

      FULL PRODUCT VERSION :
      java version "1.8.0"
      Java(TM) SE Runtime Environment (build 1.8.0-b129)
      Java HotSpot(TM) 64-Bit Server VM (build 25.0-b69, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      windows 64bit

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Using NetBeans 8

      A DESCRIPTION OF THE PROBLEM :
      It seems that the background color of a TextArea cannot be controlled. I have tried multiple methods: in a java file with .setStyle, .setBackground; in a css stylesheet (using .textarea, .textArea, .text-area, etc and using the name of my specific TextArea).

      I am able to change other properties, like font color. I am able to use the same code and change the TextArea background in Java 7u51.



      REGRESSION. Last worked in version 7u51

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      create an TextArea:

      TextArea myTA = new TextArea();
      myTA.setStyle("-fx-background-fill: black");

      or...
      in FXML:
      <TextArea layoutX="1" layoutY="250" minHeight="120" minWidth="320" editable="false" fx:id="myArea" styleClass="thisIsMine" />

      and in the CSS:
      #myArea{
          -fx-background-color: black;
          -fx-text-fill: white;
      }

      WILL change the text color. WILL NOT change the background. Neither will:

      .textarea {...
      .myArea {...
      .textArea {...
      .text-area {...
      ...etc (I tried many more combinations)


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expected a black background in the TextArea
      ACTUAL -
      TextArea always remains white. Color of font will change as expected.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      no error messages

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jgiles Jonathan Giles
                Reporter:
                anthony Anthony Petrov (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: