tags:

views:

30

answers:

0
 @SuppressWarnings("unchecked")
 private void loadToCombo(){
  List toList = GateDAO.findAll(Company.class);
  ListComboBoxModel toComboModel = new ListComboBoxModel(toList);
  toComboModel.setFirstObject("New Organization");
  recieverToCombo.setModel(toComboModel);
 }

I have the above code loading my JComboBox with the results from a Hibernate query. The ListComboBoxModel is a model that I created by extending DefaultComboBoxModel in order to use an ArrayList. There are three other combos using the same method to load the model. One of the JComboBoxes loads the "New Organization" fine while the other 2 will not. Only difference between them is that the other 2 JComboBoxes are located on a different panel. I appreciate anyone's help with this, I'm sure it is something simple that I'm just overlooking. Thanks.