java - How to set JavaFX password field echo char -


this question has answer here:

in swing, can set echo char setechochar:

new jpasswordfield().setechochar('*'); 

how can same in javafx?

it kind of ugly, but... password mask character hardcoded default skin.

what need create own skin , implement own masking function.

there existing feature request more flexible password masking functionality:

if interested in contributing the open-jfx project javafx development, nice simple way start...


as background, here making code javafx 8 com.sun.javafx.scene.control.skin.textfieldskin.java:

// use passwordfield public static final char bullet = '\u2022'; . . . @override protected string masktext(string txt) {     if (getskinnable() instanceof passwordfield) {         int n = txt.length();         stringbuilder passwordbuilder = new stringbuilder(n);         (int = 0; < n; i++) {             passwordbuilder.append(bullet);         }          return passwordbuilder.tostring();     } else {         return txt;     } } 

so can see com.sun class not make configurable.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -