Java- How do I store my numbers in my int? : I'm a beginner still trying to learn java , I have no clue what have I did wrong on my code because they seem logically correct, really appreciate if someone can give me a hand ! Thanks very much !
What I'm trying to do is create an int and when everytime I clicked yes in my confirmation dialog the int will increase by 1 and the whole program should stop executing when the number that store into that int reached to 5. 






    //This is the main game
    public class Game {
        private JPanel Game;
        private JButton Water;
        private JButton Nature;
        private JButton Fire;
        private JLabel countDownLabel;
        private JLabel computerScore;
        private int myChoice;
        private int computerChoice;
                int gamePlayed = 0; //store the times of game played


    public Game() {
        JFrame frame = new JFrame("The Elements");
        frame.setContentPane(this.Game);
        frame.setMinimumSize(new Dimension(500, 500));
        frame.pack();
        frame.setVisible(true);

                  //if the times of game played is less than 5 times , execute the following code
                   if (gamePlayed <= 5) {
                       Water.addActionListener( new ActionListener()
                       {
                           @Override
                           //Water counter Fire , Nature counter water
                           public void actionPerformed( ActionEvent e )
                           {
                               int select;
                               select = JOptionPane.showConfirmDialog( null, "You're using the power of water", "Water", JOptionPane.YES_NO_OPTION );

                               if ( select == JOptionPane.YES_OPTION )
                               {
                                   myChoice = 0;
                                   computerChoice = computerPlays();
                                   conditionsDisplayResults( myChoice, computerChoice );
                                   gamePlayed = gamePlayed + 1;//add 1 time of played game when the yes option clicked

                               }
                           }
                       } );
                       Fire.addActionListener( new ActionListener()
                       {
                           @Override
                           public void actionPerformed( ActionEvent e )
                           {
                               int select = JOptionPane.showConfirmDialog( null, "You're using the power of fire", "Fire", JOptionPane.YES_NO_OPTION );

                               if ( select == JOptionPane.YES_OPTION )
                               {
                                   myChoice = 1;
                                   computerChoice = computerPlays();
                                   conditionsDisplayResults( myChoice, computerChoice );
                                   gamePlayed += 1;//add 1 time of played game when the yes option clicked
                               }
                           }
                       } );
                       Nature.addActionListener( new ActionListener()
                       {
                           @Override
                           public void actionPerformed( ActionEvent e )
                           {
                               int select = JOptionPane.showConfirmDialog( null, "You're using the power of nature", "Nature", JOptionPane.YES_NO_OPTION );

                               if ( select == JOptionPane.YES_OPTION )
                               {
                                   myChoice = 2;
                                   computerChoice = computerPlays();
                                   conditionsDisplayResults( myChoice, computerChoice );
                                   gamePlayed += 1;//add 1 time of played game when the yes option clicked
                               }

                              
                           }
                       } );
                   }
                      
                  
                   else{ //else which when the times of game played is more than 5 times , execute the following code

                       GameResult();
                       MainMenu mainMenu = new MainMenu();

                   } 
    }