1

Если TextField находится в фокусе, то рамка вокруг него подсвечивается синим цветом.
Как переопределить цвет рамки на красный?

1 ответ 1

1

Прикручиваем css если не прикручен:

scene.getStylesheets().add( MyApplication.class.getClassLoader().getResource( "/main.css" ).toExternalForm() );
//textField.getStyleClass( "myTextFieldClass" );
//textField.setId( "myTextFieldId" );

main.css:

/*
.myTextFieldClass:focused {
.#myTextFieldId:focused {
*/
.text-field:focused {
    -fx-border-color:red;
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.