The PasswordField
is a variant of
TextField
that hides the typed input from visual
inspection.
PasswordField tf = new PasswordField("Keep it secret");
The result is shown in Figure 5.28, “PasswordField
”.
You should note that the PasswordField
hides the input
only from "over the shoulder" visual observation. Unless the server connection
is encrypted with a secure connection, such as HTTPS, the input is transmitted
in clear text and may be intercepted by anyone with low-level access to the
network. Also phishing attacks that intercept the input in the browser may be
possible by exploiting JavaScript execution security holes in the browser.
.v-textfield { }
The PasswordField
does not have its own CSS style
name but uses the same v-textfield
style as the regular
TextField
. See Section 5.6.5, “CSS Style Rules” for information on styling it.