Create a class which contains your row and column and/or whatever else you want to use as a key, and override the hashCode() and equals() methods accordingly so that equal keys return equal hashcodes from the hashCode() method and 'true' from the equals() method, and unequal keys the converse.
HashMap hm = new HashMap();
hm.put(key, value);
Set se = hm.entrySet();
for (Iterator i = se.iterator(); i.hasNext();)
{
Map.Entry me = (Map.Entry)i.next();
Object ok = me.getKey();
Object ov = me.getValue();
System.out.print(ok+"\n");
System.out.print(ov + "\n");
}