public void actionPerformed(ActionEvent e) {

            if (e.getSource() == b1) 
                count[0]++;
             else if (e.getSource() == b2) 
                count[1]++;
             else if (e.getSource() == b3) 
                count[2]++;
             else if (e.getSource() == b4) 
                count[3]++;
             else if (e.getSource() == b5) 
                count[4]++;
             else if (e.getSource() == b6) 
            {
                String s= JOptionPane.showInputDialog("Enter Password :");
                if(s.equals("qwert"))
                {            
                for (int i = 0; i < 5; i++) 
//                    System.out.println("Total votes of candidate " + (i + 1) + "are" + count[i]);
                    JOptionPane.showMessageDialog(null,"Total votes of candidate " + (i + 1) + " are :" + count[i]);
                 }
                else
                    JOptionPane.showMessageDialog(null,"Incorrect Password");
            }
        }