I want to colorize specific rows in jTable .. I did this for columns using this code,
private class CustomCellRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected, boolean hasFocus, int row, int column) { Component rendererComp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus,row, column);
And I call the above code using
jTable1.getColumnModel().getColumn(3).setCellRenderer(new CustomCellRenderer());
But I want to do the same for strings in jTable. In the case of strings, there is no getColumnModel () or getColumn (). What is this alternative way to do this? I do this in Netbeans using Java Swing ..
source share