Placing a new value to a existing key in a hashtable
<p>I am using a hashmap to populate a jtable.  The user selects a row(s) and clicks a edit button.  I am taking the value from the hashmap and placing it in a textarea.  The user can make changes and then clicks another button.  I have the new value and the key, but I am not sure how to write the changed value back to the right key in the hashmap.</p>

<p>THis is where I am writing the data out to the textarea</p>

<pre><code>private void outputSelection() {
  StringBuffer csb = new StringBuffer();
  String s = "";
  int[] row = selectTable.getSelectedRows();

  for(int i = row.length-1; i &gt;= 0; i--){
     String check = (String) EdiMapTableModel.getMapInstance().getValueAt(i, EdiMapTableModel.getMapInstance().COMMENT_COL); 
     if (!isNullOrEmpty(check)) {
        if (csb.length() &gt; 0) {
            csb.append("\n");
        }
        csb.append(check);
     }
  }

  s = csb.toString();
  csb.setLength(0);
  output.append(s);
</code></pre>

<p>}</p>

<p>This is where I am trying to put the value back</p>

<pre><code>private void inputSelection() {
  String s = output.getText();
  int[] row = selectTable.getSelectedRows();
  for(int i = row.length-1; i &gt;= 0; i--){
     TCComponentItemRevision check = (TCComponentItemRevision) EdiMapTableModel.getMapInstance().getValueAt(i, EdiMapTableModel.getMapInstance().ITEMID_COL); 
     EdiMapTableModel.getMapInstance().commentBackMap(check, s);
     repaint();
  }    
</code></pre>

<p>}</p>

<p>This is where I am trying to put it back in the map</p>

<pre><code>public void commentBackMap(int row, TCComponentItemRevision id, String comment) {

   if(model.containsKey(id)) {
          model.put(id, comment);
   }           
   fireTableDataChanged();
}// end commentBackMap()
</code></pre>

<p>I know containsKey is not right above.  id is the key value</p>

<p>Do I need to iterate through the hashmap looking for a match?  Don't know if it matters but it is a linkedhashmap instead of a hashmap</p>
