Solved

How to  UNDO  a function in java

Posted on 2003-11-14
5
243 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 35

Expert Comment

by:TimYates
ID: 9746640
0
 
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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Starting to learn JAVA, 7 59
Checkbox and ListView in Android Layout 4 56
thymeleaf natural templating vs JSP 2 65
Java Jpanels and Jframe 8 28
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

948 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now