G
Guest
Gast
Hallo, ich hab einen TableCellRenderer
Damit wird jedoch nur die ausgewählte Zelle markiert, nicht die ganze Teile, ich komm da nicht weiter ???:L [/code]
Code:
public class MyTableCellRenderer extends JTextArea implements TableCellRenderer
{
public Component getTableCellRendererComponent( JTable table,
Object value, boolean isSelected, boolean hasFocus,
int row, int column )
{
this.setBackground(row % 2 == 0 ? new Color(237,243,254) : null );
this.setText(value.toString());
// Zeile markieren
if(isSelected || hasFocus)
this.setBackground(Color.LIGHT_GRAY);
return this;
}
}