int nbFilesLeft = leftTableModel.getFileCount();
int nbFilesRight = rightTableModel.getFileCount();
int fileIndex;
String tempFileName;
AbstractFile tempFile;
for(int i=0; i<nbFilesLeft; i++) {
tempFile = leftTableModel.getFileAt(i);
if(tempFile.isDirectory())
continue;
tempFileName = tempFile.getName();
fileIndex = -1;
for(int j=0; j<nbFilesRight; j++)
if (rightTableModel.getFileAt(j).getName().equals(tempFileName)) {
fileIndex = j;
break;
}
if (fileIndex==-1 || rightTableModel.getFileAt(fileIndex).getDate()<tempFile.getDate()) {
leftTableModel.setFileMarked(tempFile, true);
leftTable.repaint();
}
}
for(int i=0; i<nbFilesRight; i++) {
tempFile = rightTableModel.getFileAt(i);
if(tempFile.isDirectory())
continue;
tempFileName = tempFile.getName();
fileIndex = -1;
for(int j=0; j<nbFilesLeft; j++)
if (leftTableModel.getFileAt(j).getName().equals(tempFileName)) {
fileIndex = j;
break;
}
if (fileIndex==-1 || leftTableModel.getFileAt(fileIndex).getDate()<tempFile.getDate()) {
rightTableModel.setFileMarked(tempFile, true);
rightTable.repaint();
}
}