錯誤的提示如下
線程「AWT-EventQueue-0」中的例外java.lang.ArrayIndexOutOfBoundsException:在org.liky.game.frame.FiveChessFrame.checkCount處索引-1超出長度20的範圍(FiveChessFrame.java:280) 在org.liky.game.frame.FiveChessFrame.checkwin(FiveChessFrame.java:183) 在org.liky.game.frame.FiveChessFrame.mousePressed(FiveChessFrame.java:141) 在java.ktop / java.awt.Component.processMouseEvent(Component.java:6611) 在java.desktop/java.awt.Component.processEvent(Component.java:6379) 在java.desktop/java.awt.Container.processEvent(Container. :第2263章 2263 .dispatchEventImpl(Container.java:2321) 在java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2769) 在java.desktop/java.awt.Component.F. 4822) 在java.桌面/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)在java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)在java.desktop/java.awt. EventQueue$4.run( EventQueue.java:715) 在java.base/java.security.AccessController.doPrivileged(AccessController.java:391) 在java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomainSecurityAccessImplile ) 在java.base /java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) 在java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) 在java.awt.EventQueue$5.run(EventQueue.java:745) 在java.desktop/java. .EventQueue$5.run (EventQueue.java:743) 在java.base/java.security.AccessController.doPrivileged(AccessController.java:391) 在java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDo長85) 在java.桌面/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)在java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)在java.desktop/java. .pumpEventsForFilter(EventDispatchThread。java:124)在java.desktop / java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)在java.desktop EventEventEvent.awt.DiDispatchThread.java:113)在java.desktop EventEventEvent.awt.DiDispatchThreadp.D. desktop / java.awt .EventDispatchThread.pumpEvents(EventDispatchThread.java:101) 在 java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
陣列越界了,看一下你的條件,存取的是不是陣列內的資料
#