List of utility methods to do JTextComponent
void | setTextStyle(JTextComponent txt) set Text Style getBasicFont(); txt.setFont(BASIC_FONT); txt.setForeground(BASIC_TEXT_COLOR); txt.setBackground(BACKGROUND); |
void | setWarningBackground(JTextComponent comp) Sets the text component's background to a color that shall indicate that the component's content is invalid with warning severity. Note: The component background colors are managed by the look&feel implementation. comp.setBackground(WARNING_BACKGROUND); |
JTextComponent | textComponentAsLabel(JTextComponent textcomponent) This will allow selection and copy to work but still retain the label look textcomponent.setEditable(false); textcomponent.setBackground((Color) UIManager.get("Label.background")); textcomponent.setForeground((Color) UIManager.get("Label.foreground")); textcomponent.setBorder(null); return textcomponent; |
String | value(JTextComponent txt) value return txt.getText();
|