Job Seven: Team Project--alpha version Sprint stage-11

Source: Internet
Author: User

Some feature implementations:

1      Public voidactionperformed (ActionEvent ae) {2         //Start button again3         if(Ae.getsource (). Equals (anew)) {4             inti,k;5             //Rearrange the position of each piece6             //Black pieces7         8             //Car9              for(i=0,k=24;i<2;i++,k+=456){        TenPlay[i].setbounds (k,56,55,55);  One             }     A              -             //Horse -              for(i=4,k=81;i<6;i++,k+=342){     thePlay[i].setbounds (k,56,55,55); -             } -              -             //Phase +              for(i=8,k=138;i<10;i++,k+=228){     -Play[i].setbounds (k,56,55,55); +             } A              at             //Shi -              for(i=12,k=195;i<14;i++,k+=114){ -Play[i].setbounds (k,56,55,55); -             } -              -             //Stroke in              for(i=16,k=24;i<21;i++,k+=114){ -Play[i].setbounds (k,227,55,55); to             } +              -             //Cannon the              for(i=26,k=81;i<28;i++,k+=342){ *Play[i].setbounds (k,170,55,55); $             }Panax Notoginseng              -             //will be thePlay[30].setbounds (252,56,55,55); +  A             //Red Pawn the             //Car +              for(i=2,k=24;i<4;i++,k+=456){ -Play[i].setbounds (k,569,55,55); $             } $              -             //Horse -              for(i=6,k=81;i<8;i++,k+=342){ thePlay[i].setbounds (k,569,55,55); -             }Wuyi              the             //Phase -              for(i=10,k=138;i<12;i++,k+=228){ WuPlay[i].setbounds (k,569,55,55); -             } About              $             //Shi -              for(i=14,k=195;i<16;i++,k+=114){ -Play[i].setbounds (k,569,55,55); -             } A              +             //Soldiers the              for(i=21,k=24;i<26;i++,k+=114){ -Play[i].setbounds (k,398,55,55); $             } the              the             //Cannon the              for(i=28,k=81;i<30;i++,k+=342){ thePlay[i].setbounds (k,455,55,55); -             } in              the             //Handsome thePlay[31].setbounds (252,569,55,55);  About      theChessplayclick = 2; theText.settext ("Red Chess Moves"); the              +              for(i=0;i<32;i++){ -Play[i].setvisible (true); the             }Bayi             //clear the contents of the vector the var.clear (); the              -         }     -          the         //Undo Button the         Else if(Ae.getsource (). Equals (repent)) { the             Try{ the                 //Get setvisible Property value -String S = (string) var.get (Var.size ()-4); the                 //get x Coordinate the                 intx = Integer.parseint ((String) Var.get (Var.size ()-3)); the                 //Get y coordinate94                 inty = Integer.parseint ((String) Var.get (Var.size ()-2)); the                 //Get Index the                 intM = Integer.parseint ((String) Var.get (Var.size ()-1));  the         98                 //assign to a pawn AboutPlay[m].setvisible (true);  -Play[m].setbounds (x,y,55,55);101                 102                 if(Play[m].getname (). charAt (1) = = ' 1 '){103Text.settext ("Black Chess Moves");104Chessplayclick = 1; the                 } 106                 Else{107Text.settext ("Red Chess Moves");108Chessplayclick = 2;109                 } the                 111                 //Delete used coordinates theVar.remove (Var.size ()-4);113Var.remove (Var.size ()-3); theVar.remove (Var.size ()-2); theVar.remove (Var.size ()-1); the                 117                 //Stop flag Flashing118chessmanclick=false;119             } -             121             Catch(Exception e) {122             }123         }124      the         //Exit126         Else if(Ae.getsource (). Equals (exit)) {127             intj=Joptionpane.showconfirmdialog ( -                  This, "Do you really want to quit?", "Exit",129 joptionpane.yes_option,joptionpane.question_message); the             131             if(J = =joptionpane.yes_option) { theSystem.exit (0);133             }134         }135}

Job Seven: Team Project--alpha version Sprint stage-11

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.