title: Unable to call the method or change the value in HashMap
body: <p>So I defined a hashmap at first: <br /></p>
  
  <pre><code>HashMap&lt;String, PrivateChat&gt; hash = new HashMap&lt;String, PrivateChat&gt;();
  </code></pre>
  
  <p>The PrivateChat is a class which has a String variant "ah" and a method "add".<br />
  But later when I try: </p>
  
  <pre><code>hash.get(name).add("hahaha"); // Add the value "hahaha" to ah variant. 
  </code></pre>
  
  <p>It does nothing. In order to prove this is real, I tried: </p>
  
  <pre><code>System.out.println(hash.get(name).ah);
  </code></pre>
  
  <p>And the output is "". 
  <br />So the next time I tried modifying ah directly: </p>
  
  <pre><code>hash.get(name).ah += "hahaha";
  </code></pre>
  
  <p>And strange things happen to me, the ah still left unchanged. <br />
  This is really a strange problem and I think no one has encountered before as I can't find any result on stackoverflow. <br />
  <br /> 
  Please help :D thanks 
  <br />
  <br />
  Here is my current code of PrivateChat: </p>
  
  <pre><code>class PrivateChat {
      public JPanel field1;
      public JTextArea textArea1;
      public JTextField textField1;
      public JButton Send;
      public JLabel eac;
  
      public String ah = "";
  
      PrivateChat(final String name, final BufferedWriter bw) {
          eac.setText("You are talking with " + name);
          textArea1.setEditable(false);
          Send.addActionListener(new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                  ArrayList&lt;String&gt; arr = new ArrayList&lt;String&gt;();
                  arr.add(name);
                  arr.add(textField1.getText());
                  String nts = Convert.ConvertToString(arr);
                  try {
                      bw.write("/tell");
                      bw.flush();
                      bw.write(nts);
                      bw.flush(); // Gut.
                      add("\n[you] " + textField1.getText());
                  } catch (IOException e1) {
                      Send.setEnabled(false);
                      textField1.setEnabled(false);
                      textField1.setText("Failed: " + e1.toString());
                  }
              }
  
          });
      }
  
      public void main(String name, BufferedWriter bw) {
          JFrame frame = new JFrame("PrivateChat");
          frame.setContentPane(new PrivateChat(name, bw).field1);
          frame.setPreferredSize(new Dimension(400, 300));
          // frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
          frame.setVisible(true);
      }
  
      public void add(String buf) {
          ah += buf;
          textArea1.setText(ah);
          System.out.println("added: " + ah);
      }
  }
  </code></pre>