title: The increment counter in method not working for java
body: <p>I am developing two separate program which involve method call from each side.Program A is MyNoteCenter.java and program B is SocketServer.java. There consist of a method call in MyNoteCenter to trigger the method in the SocketServer for download the resource, so the counter in SocketServer will increment by 1. when I click the button download inside the MyNoteCenter, it will contact the SocketServer for download request and increment the counter by one if SocketServer receive valid argument but why my counter only rise one time? it will only function well for the first time I click the download button but when I click the second time, the counter still showing 1</p>
  
  <p>This is some portion of my SocketServer program </p>
  
  <pre><code> public String getDownload()
  {
      int c = 0;
      c = c + 1;
      switch(software)
      {
  
          case "1" :
              message = "ITune";
          //    counter++;
              break;
  
          case "2" :
              message = "ZoneAlarm";
          //  counter++;
              break;
  
          case "3" :
              message = "Winrar";
          //  counter++;
              break;
  
          case "4" :
              message = "Audacity";
          //  counter++;
              break;
  
      }
  
      JOptionPane.showMessageDialog(null,"Your download is\n" +message+ "\n the number of download is\n"+c);
      return message;
  
  }
  </code></pre>
  
  <p>This is the method in MyNoteCenter, the method will be trigger after the btn2 is click which is download button, the runCC method will contact the SocketServer method for download </p>
  
  <pre><code> public static void runCC(String software,String id,String name,String job,String country)
         {
           SocketServer dc = new SocketServer(software,id,name,job,country);
           String ServerReplyMessage = dc.getDownload();
           JOptionPane.showMessageDialog(null,"Downloading :\n" +ServerReplyMessage);
           int answer = JOptionPane.showConfirmDialog(null, "Do you want to continue?", "Confirm",JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
          if (answer == JOptionPane.NO_OPTION)
          {
              JOptionPane.showMessageDialog(null,"Please click close button");
          }
         else
         {
             JOptionPane.showMessageDialog(null,"Please proceed");
         }
  </code></pre>
  
  <p><a href="http://codepad.org/" rel="nofollow">http://codepad.org/</a> >>my full SocketServer program </p>