Many combobox in table

Hi all,

I have a table with two columns, each column contains a specific combobox.

Col1 -> combo1 and col2 ->combo2.

I want when i chose a value from combo1 to fill combo2 with specific values, and this for each row in the table.

Do you have any example to make this feature ?

Thank You.

[324 byte] By [etoronaa] at [2007-11-27 11:15:09]
# 1

This posting shows how you dynamically assign a combo box to a row:

http://forum.java.sun.com/thread.jspa?forumID=57&threadID=637581

camickra at 2007-7-29 14:11:17 > top of Java-index,Desktop,Core GUI APIs...
# 2

I have already created my combo in each row for tow columns. But my problem is how to create relation between combo1 and combo2.

for example : combo1 represents countries and combo2 will be filled with cities of the selected country from combo1.

etoronaa at 2007-7-29 14:11:17 > top of Java-index,Desktop,Core GUI APIs...
# 3

Thats why you override the getCellEditor() method.

When getting the editor for column2 you need to look at the value of column1.

Take a look at this posting:

http://forum.java.sun.com/thread.jspa?forumID=57&threadID=688505

My simple example maps a model to a row. Yours will be different because you need to map cities to a country. So you could use a Hashmap to do the mapping.

camickra at 2007-7-29 14:11:17 > top of Java-index,Desktop,Core GUI APIs...