Skip to content
Permalink
Browse files
8269026: PasswordField doesn't render bullet character on Android
Reviewed-by: kcr
  • Loading branch information
Jose Pereda committed Jun 18, 2021
1 parent 171e484 commit 13cffbaad4068177d2d3239fa297302c3f94c217
Showing with 12 additions and 0 deletions.
  1. +12 −0 modules/javafx.controls/src/android/java/javafx/scene/control/skin/TextFieldSkinAndroid.java
@@ -28,6 +28,7 @@
import javafx.beans.value.ChangeListener;
import javafx.beans.value.WeakChangeListener;
import javafx.event.EventHandler;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;

@@ -39,6 +40,8 @@
*
**************************************************************************/

private static final char BULLET = '\u2022';

private final EventHandler<MouseEvent> mouseEventListener = e -> {
if (getSkinnable().isEditable() && getSkinnable().isFocused()) {
showSoftwareKeyboard();
@@ -71,6 +74,15 @@ public TextFieldSkinAndroid(final TextField textField) {
* *
**************************************************************************/

/** {@inheritDoc} */
@Override protected String maskText(String txt) {
if (getSkinnable() instanceof PasswordField) {
return String.valueOf(BULLET).repeat(txt.length());
} else {
return super.maskText(txt);
}
}

/** {@inheritDoc} */
@Override public void dispose() {
if (getSkinnable() == null) return;

1 comment on commit 13cffba

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 13cffba Jun 18, 2021

Please sign in to comment.