Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package matchgame;
- import java.util.ArrayList;
- import javax.swing.JOptionPane;
- /**
- *
- * @author deanrichards
- * version 1.0
- */
- public class MatchGame extends MainFrame {
- private int intTotalCorrect = 0;
- private int intTotalMisses = 0;
- private int ERROR_MESSAGE;
- //start new game --- reset
- public void NewGame(){
- Reset();//Set initial values
- String strName = JOptionPane.showInputDialog("Enter your name");
- while (strName.isEmpty()){
- strName = JOptionPane.showInputDialog("Enter your name");
- }
- lblDisplay.setText("Welcome " + strName + "!");
- lblHint.setText("Good Luck!");
- ArrayList<cards> CardsList = new ArrayList<cards>(11);
- }
- public void Reset(){
- try{
- int intHitCount = intTotalCorrect;
- int intMissCount = intTotalMisses;
- lblHitsNum.setText("0");
- lblMissNum.setText("0");
- lblDisplay.setText("Welcome!");
- lblHint.setText("3 Misses You Lose!");
- }
- catch(Exception e){JOptionPane.showMessageDialog(null,e,"Ooops",ERROR_MESSAGE); }
- }
- public void EndGame(){
- System.exit(1);
- }
- }
- abstract class cards{};
Add Comment
Please, Sign In to add comment