import java.awt.*;import javax.swing.*;import java.awt.event.*;import java.io.*;public class LiftMainTest{public static void main(String args[]){new LiftTest("电梯测试");}}//批量数据测试对话框class Dialog extends JDialog implements ActionListener {int Message=0;JPanel DJPanel=new JPanel();JTextField TestField[]=new JTextField[16];JLabel TestLabel1=new JLabel("时间");JLabel TestLabel2=new JLabel("人数");JLabel TestLabel3=new JLabel("起始楼层");JLabel TestLabel4=new JLabel("目标楼层");JButton ok=new JButton("确定");JButton cancel=new JButton("取消");Dialog(JFrame f,String s,boolean b){super(f,s,b);DJPanel.setLayout(new GridLayout(7,3));for(int i=0;i<=15;i++){TestField[i]=new JTextField(4);}DJPanel.add(TestLabel1);DJPanel.add(TestLabel2);DJPanel.add(TestLabel3);DJPanel.add(TestLabel4);DJPanel.add(TestField[0]);DJPanel.add(TestField[1]);DJPanel.add(TestField[2]);DJPanel.add(TestField[3]);DJPanel.add(TestField[4]);DJPanel.add(TestField[5]);DJPanel.add(TestField[6]);DJPanel.add(TestField[7]);DJPanel.add(TestField[8]);DJPanel.add(TestField[9]);DJPanel.add(TestField[10]);DJPanel.add(TestField[11]);DJPanel.add(TestField[12]);DJPanel.add(TestField[13]);DJPanel.add(TestField[14]);DJPanel.add(TestField[15]);DJPanel.add(ok);DJPanel.add(cancel);add(DJPanel);ok.addActionListener(this);cancel.addActionListener(this);setBounds(450,170,300,300);}public void actionPerformed(ActionEvent e)//Dialog监听函数{if(e.getSource()==ok){Message=1;setVisible(false);}else if(e.getSource()==cancel){Message=-1;setVisible(false);}else{;}}}//LiftTest类class LiftTest extends JFrame implements ActionListener {Dialog mydialog;JMenuBar menubar;JMenu menu,submenu,submenuhelp;JMenuItem item1,item2,menuitemhelp;//变量定义int x;int y;int LIsRun=0;//左电梯是否在运行(0或1)int RIsRun=0;//右电梯是否在运行(0或1)int LDirection=0;//左电梯运行方向int RDirection=0;//右电梯运行方向int LWantLevel=0;//乘客目的层数int RWantLevel=0;int LNowLevel=0;//乘客开始时所在层数int RNowLevel=0;int LLiftNowLevel=1;//左电梯目前所在层数int RLiftNowLevel=1;//右电梯目前所在层数int WantDirection=0;//乘客目标运行方向int WaitPeopleNum[]=new int[11];//保留数组(未用)int a=0;int b=0;//线程定义LIO lio=new LIO();RIO rio=new RIO();Thread LStartThread=new Thread(lio);Thread RStartThread=new Thread(rio);//上下电梯的按钮定义JButton Blue10=new JButton(new ImageIcon("10x.gif"));JButton Blue9=new JButton(new ImageIcon("9x.gif"));JButton Blue8=new JButton(new ImageIcon("8x.gif"));JButton Blue7=new JButton(new ImageIcon("7x.gif"));JButton Blue6=new JButton(new ImageIcon("6x.gif"));JButton Blue5=new JButton(new ImageIcon("5x.gif"));JButton Blue4=new JButton(new ImageIcon("4x.gif"));JButton Blue3=new JButton(new ImageIcon("3x.gif"));JButton Blue2=new JButton(new ImageIcon("2x.gif"));JButton Red9=new JButton(new ImageIcon("9s.gif"));JButton Red8=new JButton(new ImageIcon("8s.gif"));JButton Red7=new JButton(new ImageIcon("7s.gif"));JButton Red6=new JButton(new ImageIcon("6s.gif"));JButton Red5=new JButton(new ImageIcon("5s.gif"));JButton Red4=new JButton(new ImageIcon("4s.gif"));JButton Red3=new JButton(new ImageIcon("3s.gif"));JButton Red2=new JButton(new ImageIcon("2s.gif"));JButton Red1=new JButton(new ImageIcon("1s.gif"));//电梯门定义JButton LLiftLDoor=new JButton(new ImageIcon("LLiftLDoor.gif"));//设置门图标JButton LLiftRDoor=new JButton(new ImageIcon("LLiftRDoor.gif"));//设置门图标JButton RLiftLDoor=new JButton(new ImageIcon("RLiftLDoor.gif"));//设置门图标JButton RLiftRDoor=new JButton(new ImageIcon("RLiftRDoor.gif"));//设置门图标//电梯内部按钮定义JButton LPressButton1=new JButton("1");JButton LPressButton2=new JButton("2");JButton LPressButton3=new JButton("3");JButton LPressButton4=new JButton("4");JButton LPressButton5=new JButton("5");JButton LPressButton6=new JButton("6");JButton LPressButton7=new JButton("7");JButton LPressButton8=new JButton("8");JButton LPressButton9=new JButton("9");JButton LPressButton10=new JButton("10");JButton RPressButton1=new JButton("1");JButton RPressButton2=new JButton("2");JButton RPressButton3=new JButton("3");JButton RPressButton4=new JButton("4");JButton RPressButton5=new JButton("5");JButton RPressButton6=new JButton("6");JButton RPressButton7=new JButton("7");JButton RPressButton8=new JButton("8");JButton RPressButton9=new JButton("9");JButton RPressButton10=new JButton("10");量数据测试”按钮的Panel //组件定义JLabel LL=new JLabel("当前电梯内部人数:");JLabel RL=new JLabel("当前电梯内部人数:");JButton Start=new JButton("开始电梯调度模拟");//开始电梯调度模拟按钮JButton Test=new JButton("开始批量数据测试");//开始批量数据测试按钮JTextArea LTextArea=new JTextArea(5,5);JTextArea RTextArea=new JTextArea(5,5);//电梯调度函数Cal(LIsRun,LLiftNowLevel,q,LDirection)int Cal(int x,int y,int z,int w){return(x*(y-z)*w);}//方法函数LiftTest(String s){super(s);setSize(1000,600);setLocation(100,50);//Dialogmydialog=new Dialog(this,"批量数据测试",true);//菜单项设置menubar=new JMenuBar();menu=new JMenu("菜单");submenu=new JMenu("联系作者");submenuhelp=new JMenu("帮助");item1=new JMenuItem("程序简介");item2=new JMenuItem("源代码");menu.add(item1);menu.addSeparator();menu.add(item2);menu.addSeparator();menu.add(submenu);menu.addSeparator();menu.add(submenuhelp);submenu.add(new JMenuItem("作者简介"));submenuhelp.add(new JMenuItem("使用帮助"));menubar.add(menu);setJMenuBar(menubar);//面板布局管理器设置WindowsPanel.setLayout(new GridLayout(1,6)); WaitPeopleNumPanel.setLayout(new GridLayout(10,1)); LeftPanel.setLayout(new GridLayout(3,1));RightPanel.setLayout(new GridLayout(3,1));LeftLiftPanel.setLayout(null);//左电梯运动轨道Panel布局管理器设为空RightLiftPanel.setLayout(null);//右电梯运动轨道Panel布局管理器设为空UpDownButtonPanel.setLayout(new GridLayout(10,2)); LButtonPanel.setLayout(new GridLayout(4,3));RButtonPanel.setLayout(new GridLayout(4,3));LeftLiftPanel.setBackground(Color.green);RightLiftPanel.setBackground(Color.green); UpDownButtonPanel.setBackground(Color.yellow); UpMainPanel.setLayout(new GridLayout(1,2));LBoxPanel.setLayout(null);//左电梯箱Panel布局管理器设为空RBoxPanel.setLayout(null);//右电梯箱Panel布局管理器设为空//电梯箱设置LBoxPanel.setSize(165,51);RBoxPanel.setSize(165,51);LBoxPanel.setLocation(0,459);RBoxPanel.setLocation(0,459);LeftLiftPanel.add(LBoxPanel);RightLiftPanel.add(RBoxPanel);//电梯门设置LLiftLDoor.setEnabled(false);LLiftRDoor.setEnabled(false);RLiftLDoor.setEnabled(false);RLiftRDoor.setEnabled(false);LLiftLDoor.setSize(82,51);LLiftRDoor.setSize(82,51);RLiftLDoor.setSize(82,51);RLiftRDoor.setSize(82,51);LLiftLDoor.setLocation(0,0);LLiftRDoor.setLocation(82,0);RLiftLDoor.setLocation(0,0);RLiftRDoor.setLocation(82,0);LBoxPanel.add(LLiftLDoor);LBoxPanel.add(LLiftRDoor);RBoxPanel.add(RLiftLDoor);RBoxPanel.add(RLiftRDoor);//分别添加两个电梯的10个按钮LButtonPanel.add(LPressButton1);//左电梯LButtonPanel.add(LPressButton2); LButtonPanel.add(LPressButton3); LButtonPanel.add(LPressButton4); LButtonPanel.add(LPressButton5); LButtonPanel.add(LPressButton6); LButtonPanel.add(LPressButton7); LButtonPanel.add(LPressButton8); LButtonPanel.add(LPressButton9); LButtonPanel.add(LPressButton10); RButtonPanel.add(RPressButton1);//右电梯RButtonPanel.add(RPressButton2); RButtonPanel.add(RPressButton3); RButtonPanel.add(RPressButton4); RButtonPanel.add(RPressButton5); RButtonPanel.add(RPressButton6); RButtonPanel.add(RPressButton7); RButtonPanel.add(RPressButton8); RButtonPanel.add(RPressButton9); RButtonPanel.add(RPressButton10);//添加上下电梯按钮至UpDownButtonPanel面板JButton Unabled1=new JButton();Unabled1.setEnabled(false);JButton Unabled2=new JButton();Unabled2.setEnabled(false); UpDownButtonPanel.add(Unabled1);//开始第一个空着UpDownButtonPanel.add(Blue10); UpDownButtonPanel.add(Red9); UpDownButtonPanel.add(Blue9); UpDownButtonPanel.add(Red8); UpDownButtonPanel.add(Blue8);UpDownButtonPanel.add(Red7); UpDownButtonPanel.add(Blue7); UpDownButtonPanel.add(Red6); UpDownButtonPanel.add(Blue6); UpDownButtonPanel.add(Red5); UpDownButtonPanel.add(Blue5); UpDownButtonPanel.add(Red4); UpDownButtonPanel.add(Blue4); UpDownButtonPanel.add(Red3); UpDownButtonPanel.add(Blue3); UpDownButtonPanel.add(Red2); UpDownButtonPanel.add(Blue2); UpDownButtonPanel.add(Red1); UpDownButtonPanel.add(Unabled2);//最后一个空着//等待人数文本框定义JTextField Text10=new JTextField(" 10楼等待人数:",8); Text10.setEditable(false);JTextField Text9=new JTextField(" 9楼等待人数:",8); Text9.setEditable(false);JTextField Text8=new JTextField(" 8楼等待人数:",8); Text8.setEditable(false);JTextField Text7=new JTextField(" 7楼等待人数:",8); Text7.setEditable(false);JTextField Text6=new JTextField(" 6楼等待人数:",8); Text6.setEditable(false);JTextField Text5=new JTextField(" 5楼等待人数:",8); Text5.setEditable(false);JTextField Text4=new JTextField(" 4楼等待人数:",8); Text4.setEditable(false);JTextField Text3=new JTextField(" 3楼等待人数:",8); Text3.setEditable(false);JTextField Text2=new JTextField(" 2楼等待人数:",8); Text2.setEditable(false);JTextField Text1=new JTextField(" 1楼等待人数:",8); Text1.setEditable(false);//向UpMainPanel中添加组件UpMainPanel.add(Start);UpMainPanel.add(Test);//添加等待人数文本框至WaitPeopleNumPanel面板WaitPeopleNumPanel.add(Text10); WaitPeopleNumPanel.add(Text9); WaitPeopleNumPanel.add(Text8); WaitPeopleNumPanel.add(Text7); WaitPeopleNumPanel.add(Text6);WaitPeopleNumPanel.add(Text5);WaitPeopleNumPanel.add(Text4);WaitPeopleNumPanel.add(Text3);WaitPeopleNumPanel.add(Text2);WaitPeopleNumPanel.add(Text1);//分别向LeftPanel(左电梯提示器),RightPanel(右电梯提示器)添加相应组件LeftPanel.add(LButtonPanel);LeftPanel.add(LL);LeftPanel.add(LTextArea);RightPanel.add(RButtonPanel);RightPanel.add(RL);RightPanel.add(RTextArea);//添加至总面板WindowsPanel.add(WaitPeopleNumPanel);WindowsPanel.add(LeftPanel);WindowsPanel.add(LeftLiftPanel);WindowsPanel.add(UpDownButtonPanel);WindowsPanel.add(RightLiftPanel);WindowsPanel.add(RightPanel);//添加监听器Start.addActionListener(this);Test.addActionListener(this);Blue10.addActionListener(this);Blue9.addActionListener(this);Blue8.addActionListener(this);Blue7.addActionListener(this);Blue6.addActionListener(this);Blue5.addActionListener(this);Blue4.addActionListener(this);Blue3.addActionListener(this);Blue2.addActionListener(this);Red9.addActionListener(this);Red8.addActionListener(this);Red7.addActionListener(this);Red6.addActionListener(this);Red5.addActionListener(this);Red4.addActionListener(this);Red3.addActionListener(this);Red2.addActionListener(this);Red1.addActionListener(this);Monitor mon=new Monitor();//新建监听器对象LPressButton1.addActionListener(mon);LPressButton2.addActionListener(mon);LPressButton3.addActionListener(mon);LPressButton4.addActionListener(mon);LPressButton5.addActionListener(mon);LPressButton6.addActionListener(mon);LPressButton7.addActionListener(mon);LPressButton8.addActionListener(mon);LPressButton9.addActionListener(mon);LPressButton10.addActionListener(mon);RPressButton1.addActionListener(mon);RPressButton2.addActionListener(mon);RPressButton3.addActionListener(mon);RPressButton4.addActionListener(mon);RPressButton5.addActionListener(mon);RPressButton6.addActionListener(mon);RPressButton7.addActionListener(mon);RPressButton8.addActionListener(mon);RPressButton9.addActionListener(mon);RPressButton10.addActionListener(mon);//添加至窗口add(WindowsPanel,BorderLayout.CENTER);//主窗体添加至中间add(UpMainPanel,BorderLayout.NORTH);//UpMainPanel添加至北面setVisible(true);//Frame默认是不可见的,所有Panel都是默认可见的validate();//设置组件可见setResizable(false);//设置整个窗体是不可调整大小的setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//右上角“叉号”关闭按钮响应函数}//Runnable接口函数定义class LIO implements Runnable//左电梯接口函数{public void run(){while(true){try{Thread.sleep(5);}//避免CPU使用率达到100%catch(InterruptedException a){}while(LNowLevel!=0){int q=x;if(Cal(LIsRun,LLiftNowLevel,q,LDirection)<=Cal(RIsRun,RLiftNowLevel,q, RDirection))//左电梯近{LNowLevel=0;if(LLiftNowLevel<=q){for(int i=LLiftNowLevel;i<q;i++){LBoxPanel.setLocation(0,(459-i*51));LTextArea.append("妹妹\n");RTextArea.append("哥哥\n");LLiftNowLevel=i;LIsRun=1;LDirection=1;if(LNowLevel!=0&&i==(LNowLevel-1)&&LDirection==1&&WantDirecti on==1)//停留等待4秒{for(int v=1;v<=82;v++)//开门{try{Thread.sleep(49);}catch(InterruptedException a){}LLiftLDoor.setLocation((-v),0);LLiftRDoor.setLocation((82+v),0);}try{Thread.sleep(4000);}catch(InterruptedException a){}for(int v=1;v<=82;v++)//关门{try{Thread.sleep(49);}catch(InterruptedException a){}LLiftLDoor.setLocation((v-82),0);LLiftRDoor.setLocation((163-v),0);}}try{Thread.sleep(1000);}catch(InterruptedException a){}}}else{for(int i=LLiftNowLevel;i>q;i--){LBoxPanel.setLocation(0,(459-(i-2)*51));LTextArea.append("妹妹");RTextArea.append("哥哥");LLiftNowLevel=i;LIsRun=1;LDirection=-1;if(LNowLevel!=0&&i==(LNowLevel+1)&&LDirection==-1&&WantDirection= =-1)//停留等待4秒{for(int v=1;v<=82;v++)//开门{try{Thread.sleep(49);}catch(InterruptedException a){}LLiftLDoor.setLocation((-v),0);LLiftRDoor.setLocation((82+v),0);}try{Thread.sleep(4000);}catch(InterruptedException a){}for(int v=1;v<=82;v++)//关门{try{Thread.sleep(49);}catch(InterruptedException a){}LLiftLDoor.setLocation((v-82),0);LLiftRDoor.setLocation((163-v),0);}}try{Thread.sleep(1000);}catch(InterruptedException a){}}}LIsRun=0;LDirection=0;LLiftNowLevel=q;}else{break;}for(int e=1;e<=82;e++)//开门{if(a==1)//识别用户按下电梯箱内小按钮{x=LWantLevel;LNowLevel=LWantLevel;a=0;//"a"值复位}try{Thread.sleep(49);}catch(InterruptedException a){}LLiftLDoor.setLocation((-e),0);LLiftRDoor.setLocation((82+e),0);}for(int e=1;e<=82;e++){if(a==1)//识别用户按下电梯箱内小按钮{x=LWantLevel;LNowLevel=LWantLevel;a=0;//"a"值复位}try{Thread.sleep(49);}catch(InterruptedException a){}}for(int e=1;e<=82;e++)//关门{if(a==1)//识别用户按下电梯箱内小按钮{x=LWantLevel;LNowLevel=LWantLevel;a=0;//"a"值复位}try{Thread.sleep(49);}catch(InterruptedException a){}LLiftLDoor.setLocation((e-82),0);LLiftRDoor.setLocation((163-e),0);}}}}}class RIO implements Runnable//右电梯接口函数{public void run(){while(true){try{Thread.sleep(5);}catch(InterruptedException a){}while(RNowLevel!=0){int p=y;if(Cal(LIsRun,LLiftNowLevel,p,LDirection)>=Cal(RIsRun,RLiftNowLevel,p,RDir ection))//右电梯近{RNowLevel=0;if(RLiftNowLevel<=p){for(int i=RLiftNowLevel;i<p;i++){RBoxPanel.setLocation(0,(459-i*51));LTextArea.append("妹妹\n");RTextArea.append("哥哥\n");RLiftNowLevel=i;RIsRun=1;RDirection=1;if(RNowLevel!=0&&i==(RNowLevel-1)&&RDirection==1&&WantDirec tion==1)//停留等待4秒{for(int v=1;v<=82;v++){try{Thread.sleep(49);}catch(InterruptedException a){}RLiftLDoor.setLocation((-v),0);RLiftRDoor.setLocation((82+v),0);}try{Thread.sleep(4000);}catch(InterruptedException a){}for(int v=1;v<=82;v++){try{Thread.sleep(49);}catch(InterruptedException a){}RLiftLDoor.setLocation((v-82),0);RLiftRDoor.setLocation((163-v),0);}}try{Thread.sleep(1000);}catch(InterruptedException a){}}}else{for(int i=RLiftNowLevel;i>p;i--){RBoxPanel.setLocation(0,(459-(i-2)*51));LTextArea.append("妹妹");RTextArea.append("哥哥");RLiftNowLevel=i;RIsRun=1;RDirection=-1;if(RNowLevel!=0&&i==(RNowLevel+1)&&RDirection==-1&&WantDirection ==-1)//停留等待4秒{for(int v=1;v<=82;v++){try{Thread.sleep(49);}catch(InterruptedException a){}RLiftLDoor.setLocation((-v),0);RLiftRDoor.setLocation((82+v),0);}try{Thread.sleep(4000);}catch(InterruptedException a){}for(int v=1;v<=82;v++){try{Thread.sleep(49);}catch(InterruptedException a){}RLiftLDoor.setLocation((v-82),0);RLiftRDoor.setLocation((163-v),0);}}try{Thread.sleep(1000);}catch(InterruptedException a){}}}RIsRun=0;RDirection=0;RLiftNowLevel=p;}else{break;}for(int e=1;e<=82;e++){if(b==1)//识别用户按下电梯箱内小按钮{y=RWantLevel;RNowLevel=RWantLevel;b=0;//"b"值复位}try{Thread.sleep(49);}catch(InterruptedException a){}RLiftLDoor.setLocation((-e),0);RLiftRDoor.setLocation((82+e),0);}for(int e=1;e<=82;e++)if(b==1)//识别用户按下电梯箱内小按钮{y=RWantLevel;RNowLevel=RWantLevel;b=0;//"b"值复位}try{Thread.sleep(49);}catch(InterruptedException a){}}for(int e=1;e<=82;e++){if(b==1)//识别用户按下电梯箱内小按钮{y=RWantLevel;RNowLevel=RWantLevel;b=0;//"b"值复位}try{Thread.sleep(49);}catch(InterruptedException a){}RLiftLDoor.setLocation((e-82),0);RLiftRDoor.setLocation((163-e),0);}}}}}//"开始"按钮和"上下键"接口函数public void actionPerformed(ActionEvent e){if(e.getSource()==Start){LStartThread.start();RStartThread.start();}else if(e.getSource()==Test){mydialog.setVisible(true);}else if(e.getSource()==Red1){LNowLevel=1;RNowLevel=1;x=1;y=1;WantDirection=1; }else if(e.getSource()==Red2)LNowLevel=2;RNowLevel=2;x=2;y=2;WantDirection=1;}else if(e.getSource()==Red3){LNowLevel=3;RNowLevel=3;x=3;y=3;WantDirection=1;}else if(e.getSource()==Red4){LNowLevel=4;RNowLevel=4;x=4;y=4;WantDirection=1;}else if(e.getSource()==Red5){LNowLevel=5;RNowLevel=5;x=5;y=5;WantDirection=1;}else if(e.getSource()==Red6){LNowLevel=6;RNowLevel=6;x=6;y=6;WantDirection=1;}else if(e.getSource()==Red7){LNowLevel=7;RNowLevel=7;x=7;y=7;WantDirection=1;}else if(e.getSource()==Red8){LNowLevel=8;RNowLevel=8;x=8;y=8;WantDirection=1;}else if(e.getSource()==Red9){LNowLevel=9;RNowLevel=9;x=9;y=9;WantDirection=1;}else if(e.getSource()==Blue10){LNowLevel=10;RNowLevel=10;x=10;y=10;WantDirection=-1; }else if(e.getSource()==Blue9){LNowLevel=9;RNowLevel=9;x=9;y=9;WantDirection=-1;}else if(e.getSource()==Blue8){LNowLevel=8;RNowLevel=8;x=8;y=8;WantDirection=-1;}else if(e.getSource()==Blue7)LNowLevel=7;RNowLevel=7;x=7;y=7;WantDirection=-1; }else if(e.getSource()==Blue6){LNowLevel=6;RNowLevel=6;x=6;y=6;WantDirection=-1; }else if(e.getSource()==Blue5){LNowLevel=5;RNowLevel=5;x=5;y=5;WantDirection=-1; }else if(e.getSource()==Blue4){LNowLevel=4;RNowLevel=4;x=4;y=4;WantDirection=-1; }else if(e.getSource()==Blue3){LNowLevel=3;RNowLevel=3;x=3;y=3;WantDirection=-1; }else if(e.getSource()==Blue2){LNowLevel=2;RNowLevel=2;x=2;y=2;WantDirection=-1; }else{;}}//左右电梯电梯箱内小按钮监听器class Monitor implements ActionListener{public void actionPerformed(ActionEvent e){if(e.getSource()==LPressButton1){LWantLevel=1;a=1;}else if(e.getSource()==LPressButton2){LWantLevel=2;a=1;}else if(e.getSource()==LPressButton3){LWantLevel=3;a=1;else if(e.getSource()==LPressButton4) {LWantLevel=4;a=1;}else if(e.getSource()==LPressButton5) {LWantLevel=5;a=1;}else if(e.getSource()==LPressButton6) {LWantLevel=6;a=1;}else if(e.getSource()==LPressButton7) {LWantLevel=7;a=1;}else if(e.getSource()==LPressButton8) {LWantLevel=8;a=1;}else if(e.getSource()==LPressButton9) {LWantLevel=9;a=1;}else if(e.getSource()==LPressButton10) {LWantLevel=10;a=1;}else if(e.getSource()==RPressButton1) {RWantLevel=1;b=1;}else if(e.getSource()==RPressButton2) {RWantLevel=2;b=1;}else if(e.getSource()==RPressButton3) {RWantLevel=3;b=1;}else if(e.getSource()==RPressButton4) {RWantLevel=4;b=1;else if(e.getSource()==RPressButton5){RWantLevel=5;b=1;}else if(e.getSource()==RPressButton6){RWantLevel=6;b=1;}else if(e.getSource()==RPressButton7){RWantLevel=7;b=1;}else if(e.getSource()==RPressButton8){RWantLevel=8;b=1;}else if(e.getSource()==RPressButton9){RWantLevel=9;b=1;}else if(e.getSource()==RPressButton10){RWantLevel=10;b=1;}else{;}}}}/*//////////////////////////////////////////////////////////////////////////////////文件说明:程序用java语言编写,自行安装JDK(下载网址:)。