posted 8 years ago
So, I'm having some difficulty implementing redo/undo functions for a UI Stack Program.
I have a StackModel package that has PopEdit and PushEdit that extends an abstract ADT StackEdit that creates an ArrayStack.
In my main class, I have methods undoMenuItemActionPerformed and redoMenuItemActionPerformed which once the user clicks on each is supposed to redo/undo the last pop or push.
I've created an undoManager and call it on it whenever the pop or push functions are performed:
However, it is not undoing or redoing anything at all.
Here is my redo method and undo is similar but uses undoManager.undo() instead.
What is happening is undoManager for some reason is not redoing the last action and the program continues on and prints out "Redo Finished," etc...
Any help would be appreciated or other ways to go about the problem?
Thank you!