Renaming key value of hashmap instead of reinserting
<p>As the title says is there a simple way to change the key of my hashmap? </p>

<p>Here I update all the values of my hashmap </p>

<pre><code>stock.put(itemCode.getText(), new StockData.Item(itemName.getText(),(Double) priceS.getValue(), (Integer)quantityS.getValue(), file.getName()));
</code></pre>

<p>and now I would like to change the key, I used earlier removing and inserting data that worked but the order was changed which I don't want to happen.</p>