
CHAPTER 35
Thejavax.swing.undo Package
The classes and interfaces in this package form the undo framework for Swing
applications. The UndoManager manages a list of UndoableEdit objects, each of which
can be individually undone or redone. Any Swing application that wants to pro-
vide an undo capability will find this package useful. Figure 35-1 shows the class
hierarchy of this package.
extends implements
INTERFACE
KEY
CLASS
java.io
Object
RuntimeException
javax.swing.undo
AbstractUndoableEdit CompoundEdit UndoManager
StateEditUndoableEditSupport StateEditable
UndoableEdit
CannotRedoException
CannotUndoException
Serializable
javax.swing.event
UndoableEditListener
java.lang
Figur e 35−1: The javax.swing.undo package
AbstractUndoableEdit Ja va 1.2
javax.swing .undo serializable
This class is a simple implementation of UndoableEdit.Itenforces the restriction that an
edit cannot be undone twice or redone without first being undone. Although the undo()
and redo() methods do not actually undo or redo anything, subclasses should still call
javax.swing.
undo
683
14 September 1999 10:46