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

[CSS] setStyle() doesn't change some characteristics of text in TextArea objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 8u40
    • 8u5
    • javafx
    • None
    • Windows 7 x64

      on 8u5

      textArea.setStyle("-fx-text-fill: black;" + "-fx-background-color: white;" +
      "-fx-font-family: 'Lucida Console';" + "-fx-font-weight: bold;");
      Doesn't produce bold text in the TextArea.

      However, the above code changes the font and runs without errors.

      Steps to demonstrate the issue:

      1.

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.TextArea;
      import javafx.scene.layout.*;
      import javafx.stage.Stage;

      public class TestCase extends Application {
      @Override
          public void start(Stage stage) {
      BorderPane border = new BorderPane();

      HBox hb = new HBox();
      border.setTop(hb);

      TextArea textArea = new TextArea();
      textArea.setStyle( "-fx-text-fill: black;" +
      "-fx-background-color: white;" +
      "-fx-font-family: 'Lucida Console';" +
      "-fx-font-weight: bold;");
      hb.getChildren().addAll(textArea);

              Scene scene = new Scene(border);
              stage.setScene(scene);
              stage.setResizable(false);
              stage.show();
      }
      }

      2. javac TestCase.java

      3. java TestCase

      4. it doesn't produce bold text in the TextArea

      5. If I have supposedly taken out the quotes in the font family, the font is
      bold

      e.g -fx-font-family: Lucida Console;"

      6. However, the text doesn't display in the font I selected.

            dgrieve David Grieve
            scfitch Stephen Fitch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: