dear bunch of developers,

i have this JTable and i'm contructing it with a model object extended from a DefaultTableModel. The way i'm passing the data to it is by means of a vector:

public void setData(List<Object> data)
	{
		myTableModel.setDataVector(data);
	}

...and in my table model i have something like this:

//...
List<String> columnIdentifiers = new Vector<String>(); 

columnIdentifiers.add("COLUMN_A");
columnIdentifiers.add("COLUMN_B");
columnIdentifiers.add("COLUMN_C");
columnIdentifiers.add("COLUMN_D");

this.setDataVector(data, this.columnIdentifiers);
//...

...and now i want to set a cell renderer for the first column:

table.getColumn("COLUMN_A").setCellRenderer(
						new MyCellRenderer());

...and i'm mad 'cos i cant get the cell to render the icon it is supposed to.

anybody has already experienced this?

thanks in advance

OK, i've discovered, i was setting the data vector and when i had to change it i was changing the elements of the vector not the actual vector, so the renderer was not being called.

thanks anyway

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.