JAVA 心理测验

来源:互联网 发布:java轨迹预测算法 编辑:程序博客网 时间:2024/05/01 17:24

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import   java.lang.*;


public class Xinli extends  JFrame implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4,jlb5,jlb6,jlb7,jlb8,jlb9;
 JButton jb1,jb2;
 static int isum;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JPanel jp1;
 static int icount;
 static Xinli x ;
 String  str,st1,st2,st3,st4;
 public Xinli(){
  super("心理测试");
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("欢迎来临");
   jlb1.setBounds(220,40,120,30);
   this.getContentPane().add(jlb1);
   jlb1.setFont(new Font("楷体",Font.PLAIN,30));
   jlb1.setBackground(Color.BLUE);
  
  
   st1="请你根据自己的实际情况";
   st2="对下面15个问题如实回答";
   st3="然后对照后面的分数统计表计算分数,";
   st4="再看分数评语,你就会知道自己是否善于交朋友,以及人缘如何。";
  
  
   jlb8=new JLabel(st1);
   this.getContentPane().add(jlb8);
   jlb8.setFont(new Font("楷体",Font.PLAIN,20));
   jlb8.setBackground(Color.BLUE);
  
       jlb7=new JLabel(st2);
   this.getContentPane().add(jlb7);
   jlb7.setFont(new Font("楷体",Font.PLAIN,20));
   jlb7.setBackground(Color.BLUE);
  
  
   jlb9=new JLabel(st3);
   this.getContentPane().add(jlb9);
   jlb9.setFont(new Font("楷体",Font.PLAIN,20));
   jlb9.setBackground(Color.BLUE);
  
   jlb6=new JLabel(st4);
   this.getContentPane().add(jlb6);
   jlb6.setFont(new Font("楷体",Font.PLAIN,20));
   jlb6.setBackground(Color.BLUE);
  
     jp1=new JPanel();
     jp1.add(jlb7);
     jp1.add(jlb8);
     jp1.add(jlb6);
     jp1.add(jlb9);
     jp1.setLayout(new FlowLayout());
      this.getContentPane().add(jp1);
   jp1.setBounds(50,300,500,150);
  
        jb1= new JButton("开始");
        jb1.setBounds(190,150,80,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(290,150,80,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       image1=new ImageIcon("zi1.jpeg") ;
   jlb2=new JLabel(image1);
 jlb2.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb2);
 
/* ii2=new ImageIcon("bian.jpg") ;
     jlb3=new JLabel(ii2);
 jlb3.setBounds(0,40,30,480); 
 this.getContentPane().add(jlb3);
 
 
  ii3=new ImageIcon("bian.jpg") ;
     jlb4=new JLabel(ii3);
 jlb4.setBounds(5,0,600,30); 
 this.getContentPane().add(jlb4);
  
  
   ii4=new ImageIcon("bian.jpg") ;
     jlb5=new JLabel(ii4);
 jlb5.setBounds(555,40,30,480); 
 this.getContentPane().add(jlb5);
  
  
   ii5=new ImageIcon("bian.jpg") ;
     jlb6=new JLabel(ii5);
 jlb6.setBounds(5,530,600,30); 
 this.getContentPane().add(jlb6);
  
    
   */
  
  
   
  
 
  
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
     this.hide(); 
       Xinli1 x1=new Xinli1(x,"huan yinlai dao ");
      
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
    }
  
 
  
  
  
 public static void main(String args[]){
  
  x=new Xinli();
  System.out.println(isum);
 } 
  
  
  }
  
  class Xinli1 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 
static int  icount;
 Xinli frames;
 public Xinli1(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第1题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("你和朋友们在一起时过得很愉快,是不是因为:");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
        jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
       
         jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
         jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。你发现他们很有趣,既爱玩又会玩?");
       jrb2  =new JRadioButton("B。朋友们都很喜欢你?");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。你认为你不得不这样做。");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
        //jrb4  =new JRadioButton("shi sihi");
        //jrb4.setBounds(135,290,60,20);
       // jrb4.addActionListener( this);
       // this.getContentPane().add(jrb4);
       
         image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
       // bg.add(jrb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli2 x2=new Xinli2(frames,"huan yinlai dao ");
  
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
     if(e.getSource()==jb4){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
     
     //if(e.getSource()==jb4){
     // this.hide(); 
     // Xinli x=new Xinli();
  
    // }
     
 
if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
if(e.getSource()==jrb1){
      icount=3;
   
     }
if(e.getSource()==jrb2){
      icount=2;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}


}

 


  class Xinli2 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli2(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第2题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("2.当你休假的时候,你是否:");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
      jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
           jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。很容易交上朋友");
       jrb2  =new JRadioButton("B。比较喜欢自己一个人消磨时间");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。想交朋友,但发现这不是一件很容易的事");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
       // jrb4  =new JRadioButton("shi sihi");
        //jrb4.setBounds(135,290,60,20);
        //jrb4.addActionListener( this);
       // this.getContentPane().add(jrb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
      //  bg.add(jrb4);
       
       
        image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli3 x3=new Xinli3(frames,"huan yinlai dao ");
       //isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}

 if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
       //isum++; 
     }
     
      
     
   if(e.getSource()==jb4){
      this.hide(); 
      Xinli1 x1=new Xinli1(frames,"huan yinlai dao ");
  
     }


if(e.getSource()==jrb1){
      icount=3;
   
     }
if(e.getSource()==jrb2){
      icount=2;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }


}
}

 

class Xinli3 extends  JDialog implements ActionListener{
JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli3(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第3题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("3.当你安排好见一个朋友,但你又感到很疲倦,却不能让朋友知道你的这种状况时,你是否:");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
   
       jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
       
          jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。希望他会谅解你,尽管你没有到朋友那儿去");
       jrb2  =new JRadioButton("B。还是尽力去赴约,并试图让自己过得愉快");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。到朋友那儿去了,并且问他如果你想早回家,他是否会介意");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
       // jrb4  =new JRadioButton("shi sihi");
       // jrb4.setBounds(135,290,500,20);
        //jrb4.addActionListener( this);
       // this.getContentPane().add(jrb4);
   
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
       // bg.add(jrb4);
       
       
       
        image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli4 x4=new Xinli4(frames,"huan yinlai dao ");
      // isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
 
 if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
 
  if(e.getSource()==jb4){
      this.hide(); 
      Xinli2 x2=new Xinli2(frames,"huan yinlai dao ");
  
     }
     
     
 
if(e.getSource()==jrb1){
      icount=1;
   
     }
if(e.getSource()==jrb2){
      icount=3;
   
     }
if(e.getSource()==jrb3){
      icount=2;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}
}


class Xinli4 extends  JDialog implements ActionListener{
JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli4(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第4题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("4.你和朋友的关系一般能维持多长时间?");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
       jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
           jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。一般情况下有不少年");
       jrb2  =new JRadioButton("B。有共同感兴趣的东西时,也可能一起呆几年");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。一般时间都不长,有时是因为迁居别处");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
       // jrb4  =new JRadioButton("shi sihi");
      //  jrb4.setBounds(135,290,60,20);
       // jrb4.addActionListener( this);
       // this.getContentPane().add(jrb4);
   
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
       // bg.add(jrb4);
       
       
       
        image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli5 x5=new Xinli5(frames,"huan yinlai dao ");
      // isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli3 x3=new Xinli3(frames,"huan yinlai dao ");
  
     }
     
     
     
 
if(e.getSource()==jrb1){
      icount=3;
   
     }
if(e.getSource()==jrb2){
      icount=2;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}
}

 


class Xinli5 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli5(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第5题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("5.一位朋友向你吐露了一个非常有趣的个人问题,你是否:");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
          jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
         jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。尽自己最大努力不让别人知道它");
       jrb2  =new JRadioButton("B。根本没有想过把它传给别人听");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。当朋友刚离开,你就马上找别人来议论这个问题");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
       // jrb4  =new JRadioButton("shi sihi");
       // jrb4.setBounds(135,290,60,20);
       // jrb4.addActionListener( this);
       // this.getContentPane().add(jrb4);
   
   
   
    image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
   
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
        bg.add(jrb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli6 x6=new Xinli6(frames,"huan yinlai dao ");
       //isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli4 x4=new Xinli4(frames,"huan yinlai dao ");
  
     }
     
 
if(e.getSource()==jrb1){
      icount=2;
   
     }
if(e.getSource()==jrb2){
      icount=3;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}
}

 

class Xinli6 extends  JDialog implements ActionListener{
JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli6(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第6题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("6.当你有问题的时候,你是不是:");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
      jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
           jb3= new JButton("返回首页 ");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
         jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。通常感到自己完全能够应付这个问题");
       jrb2  =new JRadioButton("B。向你所能依靠的朋友请求帮助");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。只有问题十分严重时,才找朋友");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
        //jrb4  =new JRadioButton("shi sihi");
       // jrb4.setBounds(135,290,60,20);
        //jrb4.addActionListener( this);
        //this.getContentPane().add(jrb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
       // bg.add(jrb4);
       
        image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli7 x7=new Xinli7(frames,"huan yinlai dao ");
      // isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli5 x5=new Xinli5(frames,"huan yinlai dao ");
  
     }
 
if(e.getSource()==jrb1){
      icount=1;
   
     }
if(e.getSource()==jrb2){
      icount=2;
   
     }
if(e.getSource()==jrb3){
      icount=3;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}
}


 class Xinli7 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 
static int  icount;
 Xinli frames;
 public Xinli7(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第7题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("7.当你的朋友有困难时,你是否发现:");
  jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
        jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
       
         jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。他们马上来找你帮助");
       jrb2  =new JRadioButton("B。只有那些和你关系密切的朋友才来找你");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。通常朋友们都不会麻烦你");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
       // jrb4  =new JRadioButton("shi sihi");
        //jrb4.setBounds(135,290,60,20);
        //jrb4.addActionListener( this);
        //this.getContentPane().add(jrb4);
       
         image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
        bg.add(jrb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli8 x8=new Xinli8(frames,"huan yinlai dao ");
  
     }
     if(e.getSource()==jb2){
     System.exit(0);}
 
if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli6 x6=new Xinli6(frames,"huan yinlai dao ");
  
     }
     
     
     
if(e.getSource()==jrb1){
      icount=3;
   
     }
if(e.getSource()==jrb2){
      icount=2;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}


}


 class Xinli8 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 
static int  icount;
 Xinli frames;
 public Xinli8(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第8题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("8.你要交朋友时,是不是:");
  jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
        jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
       
         jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。通过你已经熟识的人");
       jrb2  =new JRadioButton("B。在各种场合都可以");
       jrb1.setBounds(65,220,600,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(65,260,600,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。仅仅是在一段较长时间的观察、考虑,甚至可能经历了某种困难之后才交朋友的");
        jrb3.setBounds(65,300,600,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
       // jrb4  =new JRadioButton("shi sihi");
       // jrb4.setBounds(135,290,60,20);
        //jrb4.addActionListener( this);
        //this.getContentPane().add(jrb4);
       
         image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
       // bg.add(jrb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli9 x9=new Xinli9(frames,"huan yinlai dao ");
  
     }
     if(e.getSource()==jb2){
     System.exit(0);}
 
if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli7 x7=new Xinli7(frames,"huan yinlai dao ");
  
     }
     
if(e.getSource()==jrb1){
      icount=2;
   
     }
if(e.getSource()==jrb2){
      icount=3;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}

}

  class Xinli9 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
  static int  icount;
 Xinli frames;
 public Xinli9(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第9题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("9.在这里的三种品质中,哪一种你认为是你的朋友应该具备的:");
  jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
        jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
       
         jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。使你感到快乐和幸福的能力");
       jrb2  =new JRadioButton("B。为人可靠、值得信赖");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。对你感兴趣");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
       // jrb4  =new JRadioButton("shi sihi");
        //jrb4.setBounds(135,290,500,20);
       // jrb4.addActionListener( this);
       // this.getContentPane().add(jrb4);
       
         image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
        //bg.add(jrb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli10 x10=new Xinli10(frames,"huan yinlai dao ");
  
     }
     if(e.getSource()==jb2){
     System.exit(0);}
 
if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli8 x8=new Xinli8(frames,"huan yinlai dao ");
  
     }
     
if(e.getSource()==jrb1){
      icount=3;
   
     }
if(e.getSource()==jrb2){
      icount=2;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}


}

 


  class Xinli10 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli10(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第10题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
   jlb2=new JLabel("10.下面哪一种情况对你最为合适,或者接近你的实际情况:");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
      jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
           jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。我通常让朋友们高兴地大笑");
       jrb2  =new JRadioButton("B。我经常让朋友们认真地思考");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。只要有我在场,朋友们会感到很舒服、愉快");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
       // jrb4  =new JRadioButton("shi sihi");
        //jrb4.setBounds(135,290,60,20);
       // jrb4.addActionListener( this);
        //this.getContentPane().add(jrb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
        // bg.add(jrb4);
       
       
        image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli11 x11=new Xinli11(frames,"huan yinlai dao ");
       //isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli9 x9=new Xinli9(frames,"huan yinlai dao ");
  
     }
     
     

if(e.getSource()==jrb1){
      icount=2;
   
     }
if(e.getSource()==jrb2){
      icount=1;
   
     }
if(e.getSource()==jrb3){
      icount=3;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }


}
}

 

class Xinli11 extends  JDialog implements ActionListener{
JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli11(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第11题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("11.假如让你应邀参加一次活动,或者在聚会上唱歌,你是否:");
  jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
   
       jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
       
          jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。找借口不去");
       jrb2  =new JRadioButton("B。饶有兴趣地参加");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。当场就直率地谢绝邀请");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
        //jrb4  =new JRadioButton("shi sihi");
       // jrb4.setBounds(135,290,60,20);
       // jrb4.addActionListener( this);
       // this.getContentPane().add(jrb4);
   
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
        //bg.add(jrb4);
       
       
       
        image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli12 x12=new Xinli12(frames,"huan yinlai dao ");
      // isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli10 x10=new Xinli10(frames,"huan yinlai dao ");
  
     }
     
 
if(e.getSource()==jrb1){
      icount=2;
   
     }
if(e.getSource()==jrb2){
      icount=3;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}
}


class Xinli12 extends  JDialog implements ActionListener{
JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli12(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第12题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel(" 12.对你来说,下面哪个是真实的?");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
       jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
           jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。我喜欢称赞和夸奖我的朋友");
       jrb2  =new JRadioButton("B。我认为诚实是最重要的,所以我常常不得不持有与众不同的看法,我讨厌鹦鹉学舌");
       jrb1.setBounds(65,220,600,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(65,260,600,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。我不奉承但也不批评我的朋友");
        jrb3.setBounds(65,300,600,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
        //jrb4  =new JRadioButton("shi sihi");
        //jrb4.setBounds(135,290,60,20);
        //jrb4.addActionListener( this);
        //this.getContentPane().add(jrb4);
   
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
       // bg.add(jrb4);
       
       
       
        image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli13 x13=new Xinli13(frames,"huan yinlai dao ");
      // isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli11 x11=new Xinli11(frames,"huan yinlai dao ");
  
     }
 
if(e.getSource()==jrb1){
      icount=3;
   
     }
if(e.getSource()==jrb2){
      icount=1;
   
     }
if(e.getSource()==jrb3){
      icount=2;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}
}

 


class Xinli13 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
static int  icount;
 
 public Xinli13(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第13题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("13.你是否发现:");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
          jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
          jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。你只是同那些能够与你分担忧愁和欢乐的朋友们相处得很好");
       jrb2  =new JRadioButton("B。一般来说,你几乎和所有人都能相处得比较融洽");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。有时候你甚至和对你漠不关心、不负责任的人都能相处下去");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
     //   jrb4  =new JRadioButton("shi sihi");
       // jrb4.setBounds(135,290,60,20);
      //  jrb4.addActionListener( this);
      //  this.getContentPane().add(jrb4);
   
   
   
    image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
   
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
       // bg.add(jrb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli14 x14=new Xinli14(frames,"huan yinlai dao ");
       //isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     
     
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli12 x12=new Xinli12(frames,"huan yinlai dao ");
  
     }
 
if(e.getSource()==jrb1){
      icount=1;
   
     }
if(e.getSource()==jrb2){
      icount=3;
   
     }
if(e.getSource()==jrb3){
      icount=2;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}
}

 

class Xinli14 extends  JDialog implements ActionListener{
JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 Xinli frames;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
 static int  icount;
 
 public Xinli14(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第14题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel("14.假如朋友对你恶作剧,你是否:");
  jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
      jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
           jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
         jb4= new JButton("tui chu ");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。跟他们一起大笑");
       jrb2  =new JRadioButton("B。感到气恼,但不溢于言表");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。可能大笑,也可能发火,这取决于你的情绪");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
        //jrb4  =new JRadioButton("shi sihi");
        //jrb4.setBounds(135,290,60,20);
        //jrb4.addActionListener( this);
        //this.getContentPane().add(jrb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
       // bg.add(jrb4);
       
        image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli15 x15=new Xinli15(frames,"huan yinlai dao ");
      // isum++; 
     }
     if(e.getSource()==jb2){
     System.exit(0);}
     
     
     
     
     if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
     
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli13 x13=new Xinli13(frames,"huan yinlai dao ");
  
     }
 
if(e.getSource()==jrb1){
      icount=3;
   
     }
if(e.getSource()==jrb2){
      icount=1;
   
     }
if(e.getSource()==jrb3){
      icount=2;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}
}


 class Xinli15 extends  JDialog implements ActionListener{
 JLabel jlb1,jlb2,jlb3,jlb4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
 JButton jb1,jb2,jb3,jb4;
 JRadioButton jrb1,jrb2,jrb3,jrb4;
static int  icount;
 Xinli frames;
 public Xinli15(Xinli frame1,String title){
  super(frame1,title);
  frames=frame1;
  
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("第15题:");
   jlb1.setBounds(100,40,60,20);
   this.getContentPane().add(jlb1);
  
    jlb2=new JLabel(" 15.假如朋友想依赖你,你有什么相法?");
   jlb2.setBounds(100,60,500,60);
   this.getContentPane().add(jlb2);
  
  
        jb1= new JButton("下一题");
        jb1.setBounds(65,150,100,20);
        jb1.addActionListener( this);
        this.getContentPane().add(jb1);
       
         jb2= new JButton("退出");
        jb2.setBounds(165,150,100,20);
        jb2.addActionListener( this);
        this.getContentPane().add(jb2);
       
       
       
         jb3= new JButton("返回首页");
        jb3.setBounds(255,150,100,20);
        jb3.addActionListener( this);
        this.getContentPane().add(jb3);
       
       
         jb4= new JButton("返回上一题");
        jb4.setBounds(345,150,100,20);
        jb4.addActionListener( this);
        this.getContentPane().add(jb4);
       
       
       jrb1  =new JRadioButton("A。在某种程度上不在乎,但还是希望能和朋友保持距离,有一定的独立性");
       jrb2  =new JRadioButton("B。很不错,我喜欢让别人依赖,认为我是一个可靠的人");
       jrb1.setBounds(135,220,500,20);
        jrb1.addActionListener( this);
        jrb2.setBounds(135,260,500,20);
        jrb2.addActionListener( this);
        this.getContentPane().add(jrb1);
        this.getContentPane().add(jrb2);
       
        jrb3  =new JRadioButton("C。我对此持谨慎的态度,比较倾向于避开可能要我承担的某些责任");
        jrb3.setBounds(135,300,500,20);
        jrb3.addActionListener( this);
        this.getContentPane().add(jrb3);
       
      /*  jrb4  =new JRadioButton("shi sihi");
        jrb4.setBounds(135,290,60,20);
        jrb4.addActionListener( this);
        this.getContentPane().add(jrb4);*/
       
         image1=new ImageIcon("yd.jpg") ;
   jlb4=new JLabel(image1);
 jlb4.setBounds(0,0,600,600); 
 this.getContentPane().add(jlb4);
       
        ButtonGroup bg =new ButtonGroup();
        bg.add(jrb1);
        bg.add(jrb2);
        bg.add(jrb3);
        //bg.add(jrb4);
       
        this.setSize(600,600);
        this.setVisible(true);
    }
   
   
    public void actionPerformed(ActionEvent e){
     if(e.getSource()==jb1){
      this.hide(); 
      Xinli16 x16=new Xinli16();
  
     }
     if(e.getSource()==jb2){
     System.exit(0);}
 
if(e.getSource()==jb3){
      this.hide(); 
      Xinli x=new Xinli();
  
     }
     
      if(e.getSource()==jb4){
      this.hide(); 
      Xinli14 x14=new Xinli14(frames,"huan yinlai dao ");
  
     }
     
     
if(e.getSource()==jrb1){
      icount=2;
   
     }
if(e.getSource()==jrb2){
      icount=3;
   
     }
if(e.getSource()==jrb3){
      icount=1;
   
     }
if(e.getSource()==jrb4){
      icount=4;
   
     }

}

}

 

 


class Xinli16 extends  JFrame{
 
  
 JLabel jlb1,jlb2,jlb3,jlb4,jlb5,jlb6,jlb7,jlb8,jlb9;
 int c;
 JPanel jp1;
 String  str,st1,st2,st3,st4;
 ImageIcon image1,ii2,ii3,ii4,ii5;
  public Xinli16(){
  super("心理测试");
  
   
 c=Xinli1.icount+Xinli2.icount+Xinli3.icount+Xinli4.icount+Xinli5.icount+Xinli6.icount+Xinli7.icount+Xinli8.icount+Xinli9.icount+Xinli10.icount+Xinli11.icount+Xinli12.icount+Xinli13.icount+Xinli14.icount+Xinli15.icount; 
 
   this.getContentPane().setLayout(null);
   jlb1=new JLabel("你的测验结果如下:");
   jlb1.setBounds(10,40,60,50);
   this.getContentPane().add(jlb1);
   jlb1.setFont(new Font("楷体",Font.PLAIN,50));
   //jlb1.setBackground(Color.BLUE);
 
 
 
  jlb2=new JLabel(Integer.toString(c));
   jlb2.setBounds(450,80,60,50);
   this.getContentPane().add(jlb2);
   jlb2.setForeground(Color.RED); 
   jlb2.setFont(new Font("楷体",Font.PLAIN,40));
  
  
  
  jlb9=new JLabel("恭喜,你所测的分数为:");
   jlb9.setBounds(10,80,400,50);
   this.getContentPane().add(jlb9);
 jlb9.setFont(new Font("楷体",Font.PLAIN,30));
jlb9.setForeground(Color.RED); 

 

 if(35<c&&c<46){
  jp1=new JPanel();
  jp1.setLayout(new FlowLayout());
      this.getContentPane().add(jp1);
   jp1.setBounds(0,300,600,300);
    
 st1="你对周围的朋友都很好,你们相处得不错。而且,你能够从平凡的生活中";
  st2="得到很多乐趣。你的生活是比较丰富多彩而且充实的,";
  st3="你很可能在朋友中有一定的威信,";
  st4="他们很信任你。总之,你会交朋友,你的人缘很好。";
  jlb4=new JLabel(st1); 
   this.getContentPane().add(jlb4);
   jlb5=new JLabel(st2); 
   this.getContentPane().add(jlb5);
   jlb6=new JLabel(st3); 
   this.getContentPane().add(jlb6);
   jlb7=new JLabel(st4); 
   this.getContentPane().add(jlb7);
   jp1.add(jlb4); 
   jp1.add(jlb5);
   jp1.add(jlb6);
   jp1.add(jlb7);
  
     image1=new ImageIcon("xy1.jpg") ;
           jlb8=new JLabel(image1);
        jlb8.setBounds(0,0,600,600); 
        this.getContentPane().add(jlb8);
  
 }else if(25<c&&c<36)
 {   
     jp1=new JPanel();
  jp1.setLayout(new FlowLayout());
      this.getContentPane().add(jp1);
   jp1.setBounds(0,300,600,300);
    

  st1="26-35分你的人缘不怎么好,你和朋友们的关系不牢固,时好时坏,经常处于一种起伏波动的状态中,";
  st2="这就表明,一方面你确实想让别人喜欢你,想多交一些朋友,尽管你作出很大努力,";
  st3="但是别人并不一定喜欢你,朋友跟你在一起可能不会感到轻松愉快。你只有认真坚持自己的言行,";
  st4="虚心听取那些逆耳忠言,真诚对待朋友,学会正确地待人接物,你的处境才会改变。";
  jlb4=new JLabel(st1); 
   this.getContentPane().add(jlb4);
   jlb5=new JLabel(st2); 
   this.getContentPane().add(jlb5);
   jlb6=new JLabel(st3); 
   this.getContentPane().add(jlb6);
   jlb7=new JLabel(st4); 
   this.getContentPane().add(jlb7);
   jp1.add(jlb4); 
   jp1.add(jlb5);
   jp1.add(jlb6);
   jp1.add(jlb7);
  
    image1=new ImageIcon("gb.jpg") ;
           jlb8=new JLabel(image1);
        jlb8.setBounds(0,0,600,600); 
        this.getContentPane().add(jlb8);
  
  
 }else if(0<c&&c<26){
 
 jp1=new JPanel();
 jp1.setLayout(new FlowLayout());
 this.getContentPane().add(jp1);
 jp1.setBounds(0,400,600,300);

  st1="15-25分那就太糟糕了!你很可能是一个孤僻的人,思想不活跃、不开朗、喜欢独";
  st2="来独往。但是,这一切并不意味着你不会交朋友,更不能武断地说你人缘差。其主要原";
  st3="因在于,你对于社交活动,对人和人之间的关系不感兴趣。但是,请你记住,一个人生";
  st4="活在社会中,就不可能不和人交往,认识到这一点,你就会积极地改善自己的交友方式了。";
  jlb4=new JLabel(st1); 
   this.getContentPane().add(jlb4);
   jlb5=new JLabel(st2); 
   this.getContentPane().add(jlb5);
   jlb6=new JLabel(st3); 
   this.getContentPane().add(jlb6);
   jlb7=new JLabel(st4); 
   this.getContentPane().add(jlb7);
   jp1.add(jlb4); 
   jp1.add(jlb5);
   jp1.add(jlb6);
   jp1.add(jlb7); 
   image1=new ImageIcon("bkx.jpg") ;
           jlb8=new JLabel(image1);
        jlb8.setBounds(0,400,600,300); 
        this.getContentPane().add(jlb8);
  
 }else if(c==0){
  
   image1=new ImageIcon("wu1.jpg") ;
           jlb8=new JLabel(image1);
        jlb8.setBounds(0,0,600,600); 
        this.getContentPane().add(jlb8);
  
  
 }
 

 this.setSize(600,600);
        this.setVisible(true);

}

 

 

 

 

原创粉丝点击