Java Reference
In-Depth Information
System.out.println("Class: " + value.getClass());
System.out.println("Value: " + value);
}
};
dateTextField.addActionListener(actionListener);
date2TextField.addActionListener(actionListener);
frame.setSize(250, 100);
frame.setVisible(true);
}
};
EventQueue.invokeLater(runner);
}
}
Customizing a JFormattedTextField Look and Feel
Like the JPasswordField , JFormattedTextField is a subclass of a JTextField . It, too, has the
same appearance as the JTextField under all the predefined look and feel types (see Figure 15-15).
To customize its display, you can change any of the set of 16 UIResource -related properties for
a JFormattedTextField , as shown in Table 15-9.
Table 15-9. JFormattedTextField UIResource Elements
Property String
Object Type
FormattedTextField.actionMap
ActionMap
FormattedTextField.background
Color
FormattedTextField.border
Border
FormattedTextField.caretAspectRatio
Number
FormattedTextField.caretBlinkRate
Integer
FormattedTextField.caretForeground
Color
FormattedTextField.focusInputMap
InputMap
FormattedTextField.font
Font
FormattedTextField.foreground
Color
FormattedTextField.inactiveBackground
Color
FormattedTextField.inactiveForeground
Color
FormattedTextField.keyBindings
KeyBinding[ ]
FormattedTextField.margin
Insets
FormattedTextField.selectionBackground
Color
FormattedTextField.selectionForeground
Color
FormattedTextFieldUI
String
Search WWH ::




Custom Search