Guest User

Untitled

a guest
Nov 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package matchgame;
  6.  
  7. import java.util.ArrayList;
  8. import javax.swing.JOptionPane;
  9.  
  10.  
  11.  
  12. /**
  13. *
  14. * @author deanrichards
  15. * version 1.0
  16. */
  17. public class MatchGame extends MainFrame {
  18. private int intTotalCorrect = 0;
  19. private int intTotalMisses = 0;
  20.  
  21. private int ERROR_MESSAGE;
  22.  
  23. //start new game --- reset
  24. public void NewGame(){
  25. Reset();//Set initial values
  26. String strName = JOptionPane.showInputDialog("Enter your name");
  27. while (strName.isEmpty()){
  28. strName = JOptionPane.showInputDialog("Enter your name");
  29. }
  30.  
  31.  
  32. lblDisplay.setText("Welcome " + strName + "!");
  33. lblHint.setText("Good Luck!");
  34.  
  35. ArrayList<cards> CardsList = new ArrayList<cards>(11);
  36.  
  37.  
  38. }
  39.  
  40. public void Reset(){
  41. try{
  42. int intHitCount = intTotalCorrect;
  43. int intMissCount = intTotalMisses;
  44. lblHitsNum.setText("0");
  45. lblMissNum.setText("0");
  46. lblDisplay.setText("Welcome!");
  47. lblHint.setText("3 Misses You Lose!");
  48. }
  49. catch(Exception e){JOptionPane.showMessageDialog(null,e,"Ooops",ERROR_MESSAGE); }
  50. }
  51.  
  52. public void EndGame(){
  53. System.exit(1);
  54. }
  55.  
  56. }
  57. abstract class cards{};
Add Comment
Please, Sign In to add comment