JDK-8128120 : TextArea control is unaffected by -fx-text-fill style property
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: fx2.0.2
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2011-10-26
  • Updated: 2015-06-17
  • Resolved: 2011-11-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
fx2.1Fixed
Related Reports
Relates :  
Description
The font color in the TextArea control is unchangeable via the style property. Background color and Font Family do work properly. This appears it may have a similar cause as RT-4819.

Sample program demonstrating the problem is attached.
Comments
verified in fx2.1 promotion build 15
11-03-2012

I have an exception launching this sample. On 2.1.0b13. Exception in Application start method Exception in thread "main" java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:399) at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47) at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.IllegalStateException: Location is not set. at javafx.fxml.FXMLLoader.load(FXMLLoader.java:1882) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2475) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2467) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2461) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2455) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2450) at sample.App.start(App.java:19) at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:315) at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:174) at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:141) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29) at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62) ... 1 more Java Result: 1
20-02-2012

On closer inspection, it seems that the implementation for the textFill property in TextArea was not done in 2.0.x. So sorry about that. A fix is ready for 2.1.
01-11-2011

The font face and size are honored. The background color is honored. The text color is not honored.
01-11-2011

Leif: I've tried modifying the -fx-text-fill and -fx-text-inner-color properties using css for the target by id as well as the text-area and text-input css classes. None of these affect the text color in the running app. Example: default.css #console { -fx-background-color: grey; -fx-font: 18pt "Courier New"; -fx-text-fill: white; -fx-text-inner-color: yellow; } .text-area { -fx-text-fill: green; -fx-text-inner-color: blue; } .text-input { -fx-text-fill: brown; -fx-text-inner-color: purple; } Sample.fxml: <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <BorderPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="Sample"> <center> <TextArea fx:id="console" text="The Quick Brown Fox Jumped Over The Lazy Dog."/> </center> </BorderPane> Sample.java: import java.io.IOException; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class Sample extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) throws IOException { Parent root = FXMLLoader.load(getClass().getResource("Sample.fxml")); Scene scene = new Scene(root); scene.getStylesheets().add(getClass().getResource("default.css").toString()); stage.setScene(scene); stage.show(); } } The -fx-background-color and -fx-font properties from the id targeted rules are honored. Neither the -fx-text-fill or -fx-text-inner-color properties are being honored from any of the targets.
01-11-2011

In caspian.css, the -fx-text-fill property is defined specifically for the .text-input style class, which means it is not inherited from the parent. You can either specify it directly for the .text-input or .text-area style class, or define the property -fx-text-inner-color for the container instead.
27-10-2011