How do I remove the default border glow of a JavaFX button (when selected)?

前端 未结 6 592
自闭症患者
自闭症患者 2020-11-27 15:02

I\'m trying to remove the border glow (please see screenshot below) that appears by default when a JavaFX button is selected:

6条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 15:48

    There is several way to do this. You can try any of this.

    button.setStyle("-fx-focus-color: transparent;");
    

    or

    .button{
        -fx-focus-color: transparent;
    }
    

    or

    .button:focused{
         -fx-focus-color: transparent;
    }
    

提交回复
热议问题