June 2005
Beginner to intermediate
336 pages
6h 29m
English
When the user selects the File menu's Undo menu item, Graphicizer is supposed to undo the most recent operation. For example, if you blurred an image and then selected Undo, the original version of the image would appear.
In order to undo an operation, Graphicizer makes a backup copy of each image before performing an operation, as shown here, where the backup copy, bufferedImageBackup, is made when the user clicks a button:
if(event.getSource() == button1){
bufferedImageBackup = bufferedImage;
.
.
.
Later, if the user selects the Undo menu item, all you need to do is to copy the backup image to bufferedImage and then display the newly restored image, resizing the main window if needed:
if(event.getSource() == menuitem3){ ...Read now
Unlock full access