What I want to do is, when my Edit JMenu is clicked on, before it appears I want to set enabled on the undo / redo commands based on whether or not they should be visible.
Is there a way to get such a notification? Is MenuListener what I’m looking for?
You should be able to use a MenuListener, an extended
EventListener, and enable the undo/redo items inmenuSelected.Now that I think about it, that probably would’ve been a better way for me to have done something very similar. I instead enabled/disabled the items in an
undo/redomethod in my view when my history object reported that there were no more undo/redo commands left.EDIT: I see you must’ve quickly edited your post before I had the chance to post this and found
MenuListeneryourself.