✔ 最佳答案
首先要 create 一個 object 去 store 住 D 步驟, tips 都有講要 LIFO (Last In First Out) 既, 即係要用一個 Stack:
http://java.sun.com/j2se/1.3/docs/api/java/util/Stack.html
將一個 private Stack stack; 放嚮 public class Five 既 global object 度,
記得要嚮 main() 入面 new 一個新既 Stack object 比佢.
然後嚮 Five() Constructor 入面 new 一個新既 undo button,
之後重要 add ActionListener 去個制度.
然後都係一 D logic,
1. 每行一步都要 store 個 coordinate 去個 stack 度做 undo.
2. Implement undo 果個 method.
3. 玩完隻 game 記得 destroy 個 ActionListener.