Hey I was trying to get the values from a JTable to an array and then print it. I seems like it is actually taking the adress of something instead of taking the value. I don't understand why. Here is my code:
public Object[][] getTableData (JTable table) {
DefaultTableModel dtm = (DefaultTableModel) table.getModel();
int nRow = dtm.getRowCount();
int nCol = dtm.getColumnCount();
Object[][] tableData = new Object[nRow][nCol];
for (int i = 0 ; i < nRow ; i++){
for (int j = 0; j < nCol ; j++)
tableData[i][j] = dtm.getValueAt(i,j);
}
System.out.println(Arrays.asList(tableData));
return tableData;
}