I want to add listbox for every row of a Jtable. and every listbox should be populated with different values that is retrieved from a file or a database. Here is the code for the same.
combo=new JComboBox(model1);
FileInputStream fstream= new FileInputStream("scbdata.txt");
DataInputStream in=new DataInputStream(fstream);
BufferedReader br=new BufferedReader(new InputStreamReader(in));
str=br.readLine();
s = str.split(",");
for(int i=0;i<15;i++)
model1.addElement(s[i]);
TableColumn col=m_table.getColumnModel().getColumn(3);
col.setCellEditor(new DefaultCellEditor(combo));`
When I am using the above code the same combo box is being added to the entire rows of a column but i want to add combo box with different content in each row of a particular column. Is there any way out to add a ComboBox or something in a single cell?