nice day for you i have jcombobox a fill it from database by object and it work fine with this code :
final JComboBox pruCompanyCB = new JComboBox(DAOFactory.getInstance()
.getPruComanyDAOImpl().findAll().toArray());
pruCompanyCB.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JComboBox comboBox = (JComboBox) arg0.getSource();
PruCompany pruCompany = (PruCompany) comboBox.getSelectedItem();
CRSevice.getInstance().getPruCompanySrv().setPruCompany(pruCompany);
and use next code to get selected
car.setPruCompany((PruCompany) pruCompanyCB.getSelectedItem());
But in gui the items in combobox appear like
PruCompany{id=1, country= Country{id=4, name="USA"}}
like object toString() format
how getName() from pruCompany object and show just name in combobox without change toString() method in model class any way please best regards and wishes