Java Reference
In-Depth Information
Table 15-5.
JTextField UIResource Elements (Continued)
Property String
Object Type
TextField.foreground
Color
TextField.highlight
Color
TextField.inactiveBackground
Color
TextField.inactiveForeground
Color
TextField.keyBindings
KeyBinding[ ]
TextField.light
Color
TextField.margin
Insets
TextField.selectionBackground
Color
TextField.selectionForeground
Color
TextField.shadow
Color
TextFieldUI
String
Figure 15-15 shows the appearance of the
JTextField
component for the preinstalled set
of look and feel types: Motif, Windows, and Ocean.
Figure 15-15.
JTextField under different look and feel types
JPasswordField Class
The
JPasswordField
component is designed for input of passwords. Instead of echoing what
the user types, a special input mask is displayed. It works like a
JTextField
with an input mask
of
*
. You can't unset the mask, nor can you cut or copy the contents of the password component.
The intention is to enhance security.
Creating a JPasswordField
The
JPasswordField
class has the same five constructors as the
JTextField
: