How to update JComboBox instances in Swing?
I've 3 comboboxes, upon selecting first combobox, the rest should be updated but my code doesn't seems to be working. Please help in this guys. Here is my code(since my code very long so I'll write error part only). // example code public class GuiComponents { JComboBox<String> comboBox1, comboBox2, comboBox3; public GuiComponents() { ......... ......... String[] element1 = {"item1", "item2", "item3"}; String[] element2 = {"item1", "item2", item3}; String[] element3 = {"item1", "item2", "item3"}; comboBox1.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent