Hi,
Quick background, I am using Netbeans to develop this (I don't have much experience with Swing and have lost points on experience at the chance to gain development speed). In Netbeans it is obviously restrictive as to what code you can modify to stop novice users breaking the code (which I have already amusingly done once) Anyway, I have a class of Objects, these Objects have a name property. Within the application I have directly initialised an array of these objects and called them "things";
Objects[] things = new Objects[2];
things[0] = new Objects("The first thing");
things[1] = new Objects("The second thing");
The contents and names are deliberately inane as this is a test to get this working (rather than pulling apart a part written program). After some research and reading I have discovered that I "should" be able to load objects into the setModel parameter using the following code;
new javax.swing.DefaultComboBoxModel(things[].name)
//The above is the code to use within setModel, the below is the completed example
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(things[].name));
This hasn't worked, and despite my best efforts to google this seems to be too specific to nail down a decent answer. The end result is that I would like to have; "The first thing" and "The second thing" displayed within the drop down list, and then obviously I can expand on this within the real program by referencing any other data held in that object on the screen.
Any suggestions or even pointers to help me think this out would be appreciated.