Chapter 2. USING JTEXTPANE
Topics in this Chapter
Attributes and Styles
Style Contexts
Paragraph and Character Attributes
Displaying Icons and Attributes in
JTextPane
In the last chapter, you saw how the text components store the text that they draw and how to subclass the PlainDocument
class used by JTextField
to implement various forms of input validation. PlainDocument
is a very simple text model that is sufficient for a component that uses a single font and two colors, but the Document
interface itself also allows you to associate attributes with arbitrary ranges of content within the model, a facility that can be exploited by using the JTextPane
and JEditorPane
controls.
In this chapter, you'll see exactly what the attributes that you can store ...
Get Core SWING advanced programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.