After alot of browsing I haven't yet found a solution to this.
I'm trying to change this really light blue-ish border color
around the TextFiedl
(when it's selected).
The closest I've been to was with this:
.text-field {
-fx-faint-focus-color: red;
}
But I get this result:
A really strong tone of red (the complete opposite of that soft border), that also looks thicker than the original one.
So, how can I change just the color, so that instead of a very light blue I'd be able to get, say, a very light red, whilst keeping the thickness/overall feel of the original glow?
If you are designing your Javafx application using SceneBuilder then use -fx-text-fill (if not available as option then write it in style input box) as style and give the color you want,it will change the text color of your Textfield .
Creating a Text FieldLabel label1 = new Label("Name:"); TextField textField = new TextField (); HBox hb = new HBox(); hb. getChildren(). addAll(label1, textField); hb. setSpacing(10);
then simply take a look at the default CSS stylesheet that ships with JavaFX. The file is called modena. css and can be found in the jfxrt. jar file in this location: com/sun/javafx/scene/control/skin/modena/.
Have you tried to reduce the alpha :
.text-field:focused{
-fx-faint-focus-color: transparent;
-fx-focus-color:rgba(255,0,0,0.2); /* here rgba (corrected) */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With