Skip to content

Question: Change StyleClassedTextArea Text Color #760

@SkyAphid

Description

@SkyAphid

Hello! I'm a bit of a CSS novice. So I apologize in advance if this turns out to be a stupid question.

I'm trying to change the color of the text in a StyleClassedTextArea. I've tried all sorts of things and nothing is changing it. It just stays black.

Here's all of the code:

StyleClassedTextArea projectNameField = new StyleClassedTextArea();
projectNameField.insertText(0, project.getName());
		
projectNameField.setBackground(Background.EMPTY);

String fontStyle 	= "-fx-font-family: '" + robotoRegular20.getFamily() + "'; -fx-font-size: " + robotoRegular20.getSize() + ";";
String colorStyle 	= "-fx-fill: " + Button.getTextColorCode() + ";";
String borderStyle 	= "-fx-border-color: " + Button.getTextColorCode() + "; -fx-border-width: 0 0 1 0;";
		
projectNameField.setStyle(fontStyle + colorStyle + borderStyle);

Just to clarify, the Button.getTextColorCode() works everywhere except on the text area color.

Why isn't -fx-fill working here? I also tried various other color commands. None of them do anything.

Thanks for your time and the API!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions