Chapter 23. Editor Panes and Editor Kits
Over the last four chapters we’ve covered just about all the
classes and interfaces that make up the Swing text framework. In this
chapter, we’ll look at a class that ties everything together: EditorKit. An EditorKit pulls together the document model,
document view, document editing actions, and document I/O strategy,
serving as a central reference point for a given document type.
In addition to looking at EditorKit and its subclasses, this chapter
introduces the TextAction class (an
abstract extension of AbstractAction)
and the many useful concrete action classes available as inner classes of
the EditorKit subclasses. These actions
include basic functions such as copying and pasting text as well as
style-oriented tasks such as changing font characteristics.
Throughout the chapter, we build simple but powerful editors for working with increasingly complex content types, moving from plain text to styled text to HTML. Finally, we discuss the process for creating your own editor kit.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access