Suman.hassan95 Suman.hassan95 - 1 year ago 137
Java Question

Dynamically change JComboBox

I am fetching the data values from the database successfully. I have also stored them into a

array. I need to load the String array as the items of the
in response to key actionperformed. How can I reload the items of the
whenever a key is pressed as the fetched values depend on the key pressed. Rather simply, I need to dynamically refresh the

Answer Source
DefaultComboBoxModel model = new DefaultComboBoxModel( yourStringArray );
comboBox.setModel( model );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download