Remove blue frame from JavaFX input field


Question

Is there a way to remove the blue frame from input filed?

enter image description here

1
5
4/29/2014 8:05:24 PM

Accepted Answer

The blue border you are showing is the focus border.

To remove it entirely, use something like

textField.setStyle("-fx-focus-color: -fx-control-inner-background ; -fx-faint-focus-color: -fx-control-inner-background ;");

or in an external css file

.text-field {
        -fx-focus-color: -fx-control-inner-background ;
    -fx-faint-focus-color: -fx-control-inner-background ;
}

To make it the same as the unfocused text field, use

.text-field:focused {
    -fx-background-color: linear-gradient(to bottom, derive(-fx-text-box-border, -10%), -fx-text-box-border),
        linear-gradient(from 0px 0px to 0px 5px, derive(-fx-control-inner-background, -9%), -fx-control-inner-background);
}
9
4/29/2014 8:23:52 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon