报错的提示如下
线程“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.desktop/ java.awt.Component.processMouseEvent(Component.java:6611) 在 java.desktop/java.awt.Component.processEvent(Component.java:6379) 在 java.desktop/java.awt.Container.processEvent(Container.java:第2263章 2263 .dispatchEventImpl(Container.java:2321) 在 java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2769) 在 java.desktop/java.awt.Component.dispatchEvent(Component.java: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(ProtectionDomain.java:85) 在 java.base /java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) 在 java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) 在 java.desktop/java.awt.EventQueue$5.run (EventQueue.java:743) 在 java.base/java.security.AccessController.doPrivileged(AccessController.java:391) 在 java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) 在 java.桌面/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)在java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)在java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread。 java:124)在java.desktop / java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)在java.desktop / java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)在java.desktop / java.awt .EventDispatchThread.pumpEvents(EventDispatchThread.java:101) 在 java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
数组越界了,看一下你的条件,访问的是不是数组内的数据