Here you can find the source of getTableContent(TableModel table)
public static LinkedHashMap<String, String> getTableContent(TableModel table)
//package com.java2s; //License from project: Apache License import org.apache.http.util.TextUtils; import javax.swing.table.TableModel; import java.util.LinkedHashMap; public class Main { public static LinkedHashMap<String, String> getTableContent(TableModel table) { int rowCount = table.getRowCount(); LinkedHashMap<String, String> result = new LinkedHashMap<>(); for (int row = 0; row < rowCount; row++) { String key = (String) table.getValueAt(row, 0); if (TextUtils.isEmpty(key)) continue; String value = (String) table.getValueAt(row, 1); result.put(key, value);// w w w . j av a 2 s .c o m } return result; } }