Solved

How to  UNDO  a function in java

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
stringclean challenge 26 59
strCopies  challenge 17 74
Unable to start eclipse ? 17 87
@SBGen Method 3 25
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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…

744 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

9 Experts available now in Live!

Get 1:1 Help Now