java - Add comboBox in a JTable for a DB foreign keys -
java - Add comboBox in a JTable for a DB foreign keys -
i doing databasemanager proyect display info of db table in jtable. want insert feature foreign keys of table displayed combobox values of foreign table. wondering optimal way it, know column represent foreing key going filled comboboxes exact same values, every each of them have specific default starting value. here code have right fill info without comboboxes:
private collection<map<string, string>> alldata; object[] rowtoadd = new object[manager.get((string) databasejlist.getinstance().getselectedobject()).getdatamanager().getcolumnnumber()]; (map<string, string> rowz: alldata) { rowx = rowz.values(); int = 0; (string str : rowx) { rowtoadd[i] = str; i++; } tablemodel.addrow(rowtoadd); }
so since rowtoadd array of objects, can create combobox , set inside?any suggestions how this?
thanks lot everyone.
you don't add together info model. specify combo box used editor specific. see section swing tutorial on using combo box editor working example.
java combobox foreign-keys jtable foreign-key-relationship
Comments
Post a Comment