I linked a menu item to call the undo method for non-camera on jtextpane, and assigned an accelerator key combination to cancel the call to standard Ctrl-Z. Cancellation behaves as I would like, unless I hold Ctrl-Z. When I do this, cancellation is performed in an unpredictable cadence, often freezing for 5 seconds, and then makes the batch cancel all at once. I donβt know why this is happening, because if I quickly press Ctrl-Z, there seems to be no limit to how fast it will go, implying that there is no internal performance problem with the undo method.
source share