I'm using a custom CellRenderer, see code below. I have a feeling something I'm doing in this is causing the problem. The CellRenderer itself seems to work fine showing the actual value, but when I edit the cell, I see an object reference instead of the actual value.
Here's the code:
public class PlannerCellRenderer extends JLabel implements TableCellRenderer, Serializable { private static final long serialVersionUID = 1L; private Border unselectedBorder = null; private Border selectedBorder = null; boolean isBordered = true; public PlannerCellRenderer(boolean isBordered) { super(); this.isBordered = isBordered; setOpaque(true); // MUST do this for background to show up. } public Component getTableCellRendererComponent(JTable table, Object cell, boolean isSelected, boolean hasFocus, int row, int column) { Color newColor; if(cell == null) { super.setText(""); if (isSelected) { super.setBackground(new Color(50,50,100)); } else { super.setBackground(new Color(255,255,255)); } return this; } if(column == 0 ) { super.setText((String)cell); super.setBackground(new Color(255,255,255)); super.setForeground(new Color(0,0,0)); super.setHorizontalAlignment(JLabel.LEFT); return this; } switch(((DisplayCell)cell).getCellType()) { case DisplayCell.BLANK: newColor = new Color(255,255,255); // White break; case DisplayCell.FIRSTTYPE: newColor = new Color(128,128,128); // Grey break; case DisplayCell.SECONDTYPE: newColor = new Color(0,255,0); // Green break; default: newColor = new Color(255,255,255); // White break; } if(((DisplayCell)cell).getNumberResources() == 0) { super.setText(""); } else { super.setText(Integer.toString(((DisplayCell)cell).getNumberResources())); } super.setHorizontalAlignment(JLabel.CENTER); if (isSelected) { super.setBackground(new Color(50, 50, 100)); } else { super.setBackground(newColor); } setToolTipText(DisplayCell.CELLTYPE[((DisplayCell)cell).getCellType()]); return this; } }