thanks but i found solution this is my code now and works
i write my code in here
https://programsfuture.com/wp-content/uploads/2021/03/1.jpg
https://programsfuture.com/wp-content/uploads/2021/03/2.jpg
( before ; )
{
public Component prepareRenderer ( TableCellRenderer renderer, int row, int column ){
String status = (String)jTableAzan.getModel().getValueAt(row, 1);
Component component = super.prepareRenderer(renderer,row,column);
//System.out.println("getModel= " + getModel().getValueAt(row,column));
if (jtxtshamsi.getText().equals(status)){
component.setBackground(Color.GREEN);
}
else if (getModel().getValueAt(row,column) == null){
component.setBackground(Color.ORANGE);
}
else if (getModel().getValueAt(row,column) != null){
Object value = getModel().getValueAt(row,column).toString();
if (isRowSelected(row))
{
component.setBackground(new Color(56,105,138));
component.setForeground(Color.WHITE);
if(value.equals("Friday")){
component.setForeground(Color.red);
}
}
else if(value.equals("Friday")){
component.setBackground(Color.ORANGE);
component.setForeground(Color.red);
}
else{
if (row%2 == 0){
component.setBackground(new Color(255, 255, 253));
component.setForeground(Color.BLACK);
}
else {
component.setBackground(new Color(208,205,205));
component.setForeground(Color.BLACK);
}
}
}
return component;
}
}