I would really appreciate some help here. I have been playing with this for days now and it seems like it should be a pretty simple thing to do.
I have two classes.
I have created a class called CarGeneralForm that extends AbstractForm the createFormControl() looks like:Code:public class Garage { private String name; private Set cars; // getters / setters omitted } public class Car { private String name; private String color; private Garage garage; // getters / setters omitted }
My problem is that when I display this form in a properties window (so that you can edit the car), the garage is not selected in the ComboBox.Code:protected JComponent createFormControl() { TableFormBuilder formBuilder = new TableFormBuilder(getFormModel()); JComboBox garageSelector = getFormModel().createBoundComboBox("garage", garageList.toArray()); formBuilder.row(); formBuilder.add("name"); // text field to accept the name formBuilder.row(); formBuilder.add("color"); // text field to accept the color formBuilder.row(); formBuilder.add("garage", garageSelector); // combo box containing all garages from the database return formBuilder.getForm(); }
I am at a total loss on what I am doing wrong. I have searched the forums but have not been able to find anything that helps.
Thank you very much for any assistance that anyone could offer.[/code]


Reply With Quote