0
public void addRowsAntGrouping(){
			
			Vector vectorAddRow = new Vector();
			
			vectorAddRow.add("");
			vectorAddRow.add("");
			((DefaultTableModel)jTableAntGrouping.getModel()).addRow(vectorAddRow);
			
		}

Hi,
I am in need of replacing the textfield of a table with combobox. the rows in the table are declared as vectors. there are two fields in the table. the first field is text and second is a combobox. can u please help me. thanx in advance.

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by masijade
0

The vector contains the data in the cells, not how it is to be displayed. What you need to change is the CellRenderer.

See the Swing JTable Tutorial paying special attention to the Using Custom Renderers section.

0

hi,
i viewed the site but i need whether the combobox can be placed as an object inside the vector.

i need like this

Vector vectorAddRow = new Vector();

vectorAddRow.add("");
vectorAddRow.add(combobox);

please make it clear that a combobox can be an object that needs to be placed in vector.

thankx for ur reply.

0

What did I say? I said the Vector contains only the values, not the views. You need to declare and use a specific Renderer on the Column that needs one. Read the tutorial again, because you seemingly did not understand it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.