I have a jtable which is consists of columns :
C No, Borrower, Market, Loan, Start, Daily, Expiry
how can i highlight the table row if the current date is 5 days away from the date inside the column 'expiry'
?
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
String expDateString = sdf.format(cal.getTime()).toString();
System.out.println(expDateString);
String nana = tableSummary.getModel().getValueAt(row, 6).toString();
System.out.println(nana);
for(int i=0; i<=tableSummary.getRowCount()-1; i++){
if(nana.compareTo(expDateString)>=0){
rowrenderer.setBackground(Color.RED);
}
}