I want to compare the dates in 2 columns of the same table.
I currently have the following code which prints the data from column 2 and 3 of the JTable
but what I need to do is determine if a date falls between the 2 dates of the columns. How would I do this?
public Object[][] betweendates (JTable table) {
String tab ="\t";
String newLine ="\n";
TableModel dtm = table.getModel();
int nRow = dtm.getRowCount(), nCol = dtm.getColumnCount();
Object[][] tableData = new Object[nRow][nCol];
for (int i = 0 ; i < nRow ; i++)
{
for (int j = 2 ; j <= 3 ; j++)
{
tableData[i][j] = dtm.getValueAt(i,j);
System.out.print(tableData[i][j]);
comparedates(tableData[i][j]);
System.out.print("\t");
}
System.out.println();//create a new line
}
return tableData;
}