Basically I have changed the css for a text field in javafx by adding a style class like this:
Thanks to the comments by @UlukBiy and @varren I solved the issue.
System.out.println(textfield.getStyleClass()); was of great use since it allowed me to check which style classes were applied on the text field as default. And as pointed out in the comments those where
So to restore the text field css to its default value I just did:
textfield.getStyleClass().clear(); textfield.getStyleClass.addAll("text-field", "text-input");