Hello, I am new to forum.
I could use some help with code. I having problem how to make jcombobox to display names but to insert integer into database. Here's my code:
[Java] ///Populate jComboBox private void FillCombo(){ String sql = "Select I - Pastebin.com
jComboBox1.addItem(gggg +"."+" "+" "+ nme +" "+ ggg); First object gggg (int) is there a way I call only it when inserting into database? I tried .getItemAt(1) and .getSelectedIndex()... But no use...
Everything works fine if i use jcombobox to show ID primary numbers from database, than i can insert into foreign key with .getSelectedItem(); But i need it to display name of person and to insert it's ID number.