sz[m][n+2].setIcon(image); flag=0; s[m][n+2]=2; } else if(s[m][n-1]==0 &&n-1>-1){ ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m][n-1].setIcon(image); flag=0; s[m][n-1]=2; } else aa(); } else if(s[m-1][n-1]==1 &&m-1>-1 &&n-1>-1){ if(s[m-2][n-2]==0 &&m-2>-1 &&n-2>-1){ ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m-2][n-2].setIcon(image); flag=0; s[m-2][n-2]=2; } else if(s[m+1][n+1]==0 &&m+1<3 &&n+1<3){ ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m+1][n+1].setIcon(image); flag=0; s[m+1][n+1]=2; } else aa(); } else if(s[m+1][n+1]==1 &&m+1<3 &&n+1<3){ if(s[m+2][n+2]==0 &&m+2<3 &&n+2<3) { ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m+2][n+2].setIcon(image); flag=0; s[m+2][n+2]=2; } else if(s[m-1][n-1]==0 &&m-1>-1 &&n-1>-1){ ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m-1][n-1].setIcon(image); flag=0; s[m-1][n-1]=2; } else aa(); } else if(s[m-1][n+1]==1 &&m-1>-1 &&n+1<3){ if(s[m-2][n+2]==0 &&m-2>-1 &&n+2<3) { ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m-2][n+2].setIcon(image); flag=0; s[m-2][n+2]=2; } else if(s[m+1][n-1]==0 &&m+1<3 &&n-1<-1){ ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m+1][n-1].setIcon(image); flag=0; s[m+1][n-1]=2; } else aa(); } else if(s[m+1][n-1]==1 &&m+1<3 &&n-1>-1){ if(s[m+2][n-2]==0 &&m+2<3 &&n-2>-1) { ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m+2][n-2].setIcon(image); flag=0; s[m+2][n-2]=2; } else if(s[m-1][n+1]==0 &&m-1>-1 &&n+1<3){ ImageIcon image = new ImageIcon("D://图/头文字D/2.PNG"); image.setImage(image.getImage().getScaledInstance(72,72,Image.SCALE_DEFAULT)); sz[m-1][n+1].setIcon(image); flag=0; s[m-1][n+1]=2; } else aa(); } else aa(); } //else if(a==2) 结束 } //if(flag==1) 结束 } //else 结束 } public static int check(){ for(i=0;i<3;i++) for(j=0;j<3;j++) { if(s[i][j]==1 && s[i-1][j]==1 && s[i+1][j]==1&&i-1>-1 &&i+1<3) return 1; else if(s[i][j]==1 && s[1][j-1]==1 && s[i][j+1]==1 &&j-1>-1&&j+1<3) return 1; else if(s[i][j]==1 && s[i-1][j-1]==1 && s[i+1][j+1]==1 &&i-1>-1 &&i+1<3 &&j-1>-1 &&j+1<3) return 1; else if(s[i][j]==1 && s[i+1][j-1]==1 && s[i+1][j-1]==1 &&i-1>-1 &&i+1<3 &&j-1>-1 &&j+1<3) return 1; else if(s[i][j]==1 && s[i-1][j]==1 && s[i-2][j]==1 &&i-1>-1 &&i-2>-1) return 1; else if(s[i][j]==1 && s[i][j-1]==1 && s[i][j-2]==1 &&j-1>-1 && j-2>-1) return 1; else if(s[i][j]==1 && s[i-1][j-1]==1 && s[i-2][j-2]==1 &&i-1>-1&&i-2>-1 &&j-1>-1&&