Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to  UNDO  a function in java

Posted on 2003-11-14
5
Medium Priority
?
250 Views
Last Modified: 2010-03-31
I need to have a UNDO function in java using the (CONTROL and Z )key pressed.
Please try to give the solution because it is quite so important to me.
0
Comment
Question by:ashok3sep
  • 2
5 Comments
 
LVL 5

Author Comment

by:ashok3sep
ID: 9746957
But i want to undo all the previous operation not text element but also if i make any changes in my diagram.
0
 
LVL 35

Accepted Solution

by:
TimYates earned 200 total points
ID: 9747015
http://www.javaworld.com/javaworld/jw-06-1998/jw-06-undoredo.html

Shows how to use the UndoManager with a list...  

Basically, each operation the user performs has to be a class that extends AbstractUndoableEdit.  It is up to you to provide the implementations that say whether an operation can be undone, what happens when it is undone, and how it can be redone...

The applet doesn't work on that page, but the code is valid :-)

Tim.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question