The documentation for TextField says that the prompt text is shown "...when there is no text already in the TextField..." but, in fact, it stops showing the prompt text as soon as the control has focus.
It seems that there are valid situations where one might want it to work either way ('show prompt until control has focus' vs. 'show prompt until text is entered'), so perhaps this should be controlled by another property.
However, at the very least, the documentation is incorrect.
It seems that there are valid situations where one might want it to work either way ('show prompt until control has focus' vs. 'show prompt until text is entered'), so perhaps this should be controlled by another property.
However, at the very least, the documentation is incorrect.
- duplicates
-
JDK-8125161 PasswordField: Prompt disappears on focus
- Closed
- relates to
-
JDK-8100686 [TextField, TextArea] Prompt text is not removed when the control gets focus
- Resolved
-
JDK-8090334 TextField.setEditable(false) removes prompt when focused
- Open