title: hashmap not hold values?
body: <p>In the following code, if  jcbValue evaluates to Find, I have it set to print the contents of the hashmap. It is returning NULL. I am assuming this means that by that point the contents of the hashmap have been emptied. </p>
  
  <p>My questions are as follows;
  1) What am I doing wrong?
  2) How do I fix it?</p>
  
  <p>Thanks,
  CJ</p>
  
  <pre><code>   public class ButtonListener implements ActionListener {
     public void actionPerformed(ActionEvent e) {
  
          HashMap&lt;String, ArrayList&gt; map = new HashMap&lt;String, ArrayList&gt;();
  
          String jcbValue = (String) jcbIDF.getSelectedItem();
          if (jcbValue == "Insert") {
  
              String Id = jtfId.getText();
              ArrayList&lt;String&gt; ValueList = new ArrayList&lt;String&gt;();
              String Name = jtfName.getText();
              String GPA = jtfGPA.getText();
              ValueList.add(Name);
              ValueList.add(GPA);
              map.put(Id, ValueList);
              System.out.println(map);
  
              JOptionPane.showMessageDialog(null, "Record Inserted",
                      "Result", JOptionPane.INFORMATION_MESSAGE);
              // jtfId.setText("");
              // jtfName.setText("");
              // jtfGPA.setText("");
          } else if (jcbValue == "Delete") {
              System.out.println(map);
              JOptionPane.showMessageDialog(null,
                      "Delete Selected; But Not Implemented", "Result",
                      JOptionPane.INFORMATION_MESSAGE);
          } else if (jcbValue == "Find") {
              System.out.println(map);
              JOptionPane.showMessageDialog(null,
      "Find Selected; But not Implemented", "Result",
                      JOptionPane.INFORMATION_MESSAGE);
          }
      }// Terminates actionPerformed Class
      }// Terminates ButtonListenerClass        
  </code></pre>