Chapter 9. THE SWING UNDO PACKAGE

Topics in this Chapter

  • Using the Undo Package

  • Creating Your Own UndoableEdits

  • Extending UndoManager

A graphical user interface (GUI) should be designed to allow the user to do what he or she needs to do with minimal effort. There is, however, another side to this coin. As well as making it possible for the user to do something, it is also important to give the user the ability, where it makes sense, to reverse an action that turned out to be inappropriate. For example, as we saw in the first few chapters of this book, the Swing text components allow the user to change the style of large stretches of text or to delete anything from a single character to entire paragraphs with only a few mouse clicks or key presses. ...

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.