Chapter 22. Styled Text Panes

In this chapter we’ll discuss Swing’s most powerful text component, JTextPane, as well as the Document model and the many classes and interfaces that go along with it. All text components use the Document interface to interact with their models. JTextPane uses the StyledDocument interface, an extension of the Document interface with style-manipulation methods.

This is a long chapter because there are so many classes and interfaces used by Document and its ilk. You may have no immediate need to learn about some of these classes, especially those in the latter half of the chapter. Don’t feel that you must read the chapter straight through.

Get Java Swing, 2nd Edition 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.