I'm trying to skin the TextArea control, but it seems to be ignoring the
-fx-text-fill style option. I've tried setting the style in code, FXML and css (preferred solution). Here is what I currently have for code:
App.java:
package spike;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.stage.*;
public class App extends Application {
@FXML
private TextInputControl console;
public static void main(String[] args) { Application.launch(args); }
@Override
public void start(Stage stage) throws IOException {
Parent root = FXMLLoader.load(getClass().getResource("App.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("default.css").toString());
stage.setScene(scene);
stage.show();
}
}
App.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="spike.App">
<center>
<TextArea fx:id="console" />
</center>
</BorderPane>
default.css:
#console {
-fx-background-color: black;
-fx-font: 18pt "Serif";
-fx-text-fill: white;
}
Changing the TextArea tag in the fxml file to TextField causes the font color to be correct, however does not provide the interface I am trying to achieve. I can't find any open bugs for this, but I'm fairly certain I would not be the first to notice this. Any ideas?