create the HashMap based on JTable
问题 There is JTable with the following content Col1 | Col2 A | 1 A | 2 A | 3 B | 5 B | 1 C | 5 C | 4 C | 2 Based on this table, I need to create a HashMap numbers : column 1 refers to keys and column 2 refers to data. Below I provide my code snippet. The question is: is there any quicker way to create the mentioned HashMap? HashMap numbers = new HashMap<String, List<String>>(); for (int i=0; i<tbNumbers.getRowCount(); i++) { col1 = mdNumbers.getValueAt(i,0).toString(); col2Array = new ArrayList