撒科打诨
MazeGamePanel里提出:
private JPanel labels;
private java.util.Timer timer3;构造方法和showTime方法里去掉定义。
showTime前面改成如下:
private void showTime(JPanel labels) {
if (null != timer3) {
timer3.cancel();
timer3 = null;
}
timer3 = new java.util.Timer();
ButtonListener的newMaze方法后加入:
MazeGamePanel.this.showTime(MazeGamePanel.this.labels);