JavaFX - Set focus border for Textfield using CSS -


i want have textfield 3 different borders 3 cases:

  • a white border when not hovered or focused
  • a grey border when hovering
  • a blue border when focused , typing

i started this:

#custom-text-field  {     -fx-border-width: 2;     -fx-border-color: white; }  #custom-text-field:hover{     -fx-border-width: 2;     -fx-border-color: #909090; }  #custom-text-field:focused{     -fx-border-width: 2;     -fx-border-color: #0093ef; } 

the problem border focusing never shows up. how set correctly?

i use this

.custom-text-field {     -fx-background-color:         #ffffff,         #ffffff;     -fx-background-insets: 0, 2;     -fx-background-radius: 0, 0;  }  .custom-text-field:focused {     -fx-background-color:         #0093ef,         #ffffff; }  .custom-text-field:hover {     -fx-background-color:         #909090,         #ffffff; }  .custom-text-field:focused:hover {     -fx-background-color:         #0093ef,         #ffffff; } 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -