Undo button for drawings in a JFrame
问题 I am drawing some objects on a JFrame such as circles, rectangles and arcs between them. I was wondering how I can implement an Undo button bearing in mind that the ones I found are targeted at text fields and writing in them. I don't have code to show and I wish to receive advice on how to implement it. Is it possible to 'register' the last event that occurred and then delete it? I have a very simple code about deleting the circles for instance. It works only for them and I know that it is