To change the text color of a typed input in JavaFX, such as in a TextField or TextArea, you need to apply CSS styling to that particular component.
Example CSS
.text-field {
-fx-text-fill: white; /* Changes text color to white */
}
Link the scene to css:
scene.getStylesheets().add("path/to/your/style.css");
OR
you can set it directly in your code
TextField textField = new TextField();
textField.setStyle("-fx-text-fill: white;"); // Set the text color to white