Java Reference
In-Depth Information
JScrollPane scrollPane = new JScrollPane(editorPane);
frame.add(scrollPane);
} catch (IOException e) {
System.err.println("Unable to load: " + e);
}
frame.setSize(640, 480);
frame.setVisible(true);
}
};
EventQueue.invokeLater(runner);
}
}
Customizing a JEditorPane Look and Feel
The appearance of the JEditorPane is similar to that of a JTextArea (see Figure 15-18). Although
the supported contents differ, the look-and-feel-related attributes usually aren't different.
The available set of 15 UIResource -related properties for a JEditorPane is shown in Table 15-13.
Their names are similar to those of the JTextArea settings.
Table 15-13. JEditorPane UIResource Elements
Property String
Object Type
EditorPane.actionMap
ActionMap
EditorPane.background
Color
EditorPane.border
Border
EditorPane.caretAspectRatio
Number
EditorPane.caretBlinkRate
Integer
EditorPane.caretForeground
Color
EditorPane.focusInputMap
InputMap
EditorPane.font
Font
EditorPane.foreground
Color
EditorPane.inactiveForeground
Color
EditorPane.keyBindings
KeyBinding[ ]
EditorPane.margin
Insets
EditorPane.selectionBackground
Color
EditorPane.selectionForeground
Color
EditorPaneUI
String
Search WWH ::




Custom Search