大侠帮帮忙,我是菜鸟,刚开始学,基本上是抄书的,自己改了加了一丁点,小弟万分感谢!
这个程序有三个问题:
1.递归那里只能出来一种结果?
2.图形显示那里显示一种按键?
3.就是参数传递那里出问题了,为什么会这样啊?

代码如下:
import java.awt.*;
import java.applet.Applet;
import javax.swing.JFrame;

public class queens_main_test extends Applet{
    public static char Chessboard[][]=new char[8][8];
    int X,Y;
    public static int eight_Queens(int X,int Y,int Queens){//递归方法
        Applet display=new Applet();
        int i,j;
        int Result=0;
        if(Queens==8){
            display.init();    
            return 1;}
        else
            if(CheckSafety(X,Y))
            {
                Chessboard[X][Y]='Q';

                for(i=0;i<8;i++)
                    for(j=0;j<8;j++)
                    {
                        Result=Result+eight_Queens(i,j,Queens+1);
                        if(Result>0)
                            break;
                    }
                if(Result>0)
                    return 1;
                else{
                    Chessboard[X][Y]='X';
                    return 0;
                }
            }
            else
                return 0;
        
    }

    
    public static boolean CheckSafety(int X,int Y)//判安全方法
    {
        int i,j;
        if(Chessboard[X][Y]!='X')//判断当前位置是否有皇后
            return false;
        for(i=X-1;i>=0;i--)     //判断左边是否有皇后。
            if(Chessboard[i][Y]!='X')
                return false;
        for(i=X+1;i<8;i++)      //判断右边是否有皇后
            if(Chessboard[i][Y]!='X')
                return false;
        for(j=Y-1;j>=0;j--)     //判断上方是否有皇后
            if(Chessboard[X][j]!='X')
                return false;
        for(j=Y+1;j<8;j++)      //判断下方是否有皇后
            if(Chessboard[X][j]!='X')
                return false;
        i=X-1;                  //判断左上是否有皇后
        j=Y-1;
        while(i>=0&&j>=0)
           if(Chessboard[i--][j--]!='X')
               return false;
        i=X+1;                  //判断右下是否有皇后
        j=Y+1;
        while(i<8&&j<8)
           if(Chessboard[i++][j++]!='X')
               return false;
        i=X+1;                 //判断右上是否有皇后   
        j=Y-1;
        while(i<8&&j>=0)
           if(Chessboard[i++][j--]!='X')
               return false;
        i=X-1;                //判断左下是否有皇后
        j=Y+1;
        while(i>=0&&j<8)
           if(Chessboard[i--][j++]!='X')
               return false;
        return true;
                
    }
    public  void  init() {//画图方法
        
    
        setSize(500,500);
        setLayout(new GridLayout(8,8));
        setSize(750,600);
        setFont(new Font("Times New Roman",Font.BOLD,24));
        
        for(X=0;X<8;X++)
            for(Y=0;Y<8;Y++){
        if(Chessboard[X][Y]=='Q'){
                    add(new Button("Q"));
        }else add(new Button("X"));
            }
      
                

        }

    
    public static void main(String[] args) {//主程序
        
    
                
        eight_Queens(0,0,0);
        
        
          }
}
[em18]