I have a Swings GUI which contains a JComboBox and I want to load data into it from the database.
I have retrieved the data from the database in a String Array. Now how can I populate this String array into the JComboBox
EDITED====================================================================
In actual, the JComboBox is already instantiated when the java GUI is shown to the user. So I can't pass the Array as a paramter to the constructor.
How can I populate the already instantiated JComboBox?
The following is the code that is Nebeans generated code.
jComboBox15 = new javax.swing.JComboBox();
jComboBox15.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "12" }));
jComboBox15.setName("jComboBox15");
Can I set another ComboBoxModel to the above jComboBox?