Setting the -fx-text-fill
works for me.
See below:
if (passed) {
resultInfo.setText("Passed!");
resultInfo.setStyle("-fx-text-fill: green; -fx-font-size: 16px;");
} else {
resultInfo.setText("Failed!");
resultInfo.setStyle("-fx-text-fill: red; -fx-font-size: 16px;");
}
Related Contents:
- Passing Parameters JavaFX FXML
- How to get stage from controller during initialization?
- JavaFX periodic background task
- How do I remove the default border glow of a JavaFX button (when selected)?
- Does JavaFX have a “native look and feel” option like Swing?
- JavaFX How to set scene background image
- JavaFX8: How to create listener for selection of row in Tableview?
- How to create a modal window in JavaFX 2.1
- ScrollPanes in JavaFX 8 always have gray background
- Make portion of a text bold in a JavaFx Label or Text
- Loading new fxml in the same scene
- Google Maps & JavaFX: Display marker on the map after clicking JavaFX button
- Swing vs JavaFx for desktop applications [closed]
- Is it possible to run JavaFX applications on iOS, Android or Windows Phone 8?
- How does JavaFX compare to WPF? [closed]
- JavaFX – setVisible hides the element but doesn’t rearrange adjacent nodes
- IntelliJ can’t recognize JavaFX 11 with OpenJDK 11
- Where has the JavaFX scene builder gone?
- Using JavaFX in JRE 8, “Access restriction” error
- javac: invalid target release: 1.8
- Error: JavaFX runtime components are missing, and are required to run this application with JDK 11 [duplicate]
- How to close a JavaFX application on window close?
- Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)?
- JavaFX – can it really be deployed in a browser? [closed]
- How to find an element with an ID in JavaFX?
- Why is javafx mangling my semi-transparent cursors?
- All my JavaFX TextFields have lines in them
- close fxml window by code, javafx
- Label and Text differences in JavaFX
- Javafx 2 click and double click
- How do I resize an imageview image in javafx?
- What’s the location of the JavaFX runtime JAR file, jfxrt.jar, on Linux?
- macOS – How to install Java 17
- How to resize JavaFX ScrollPane content to fit current size
- Packaging jar is invalid Aggregator project need pom as packaging
- Applying MVC With JavaFx
- JavaFX TableView text alignment
- What’s the difference between fx:id and id: in JavaFX?
- Adding space between buttons in VBox
- Graph Visualisation (like yFiles) in JavaFX
- Maven project with JavaFX (with jar file in `lib`)
- JavaFX on Linux is showing a “Graphics Device initialization failed for : es2, sw”
- Auto fit size column in table view
- How to deploy a JavaFX 11 Desktop application with a JRE
- ListView with custom CellFactory trims invisible nodes
- IntelliJ IDEA – getClass().getResource(“…”) return null
- Setting a cookie using JavaFX’s WebEngine/WebView
- JavaFX Alerts and their size
- How to get the version number of JavaFX?
- JavaFX FXML API version warning