To put object inside JComboBox
we do like this:
while(result.next()){
int id=rs.getInt("id");
String name=rs.getString("name");
Object[] itemData = new Object[] {id, name};
jComboBox1.addItem(itemData);
}
I need the combo box to show only the itemData.name
and to store the whole object inside the jcombobox
Is there an appropriate way?