Vaadin Framework - Server-Side Components - PasswordField
 Edit This Page


Live Demo

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 PasswordField.

passwordfield basic
Figure 1. 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.

CSS Style Rules

.v-textfield { }

The PasswordField does not have its own CSS style name but uses the same v-textfield style as the regular TextField. See "CSS Style Rules" for information on styling it.