Updating JComboBox
问题 So I'm using a JComboBox with an ArrayList : protected JComboBox<String> jcb; protected ArrayList<String> favourites; favourites.add("Favourites"); favourites.add("-0.21 + 0.77"); favourites.add("-0.16 + -0.89"); jcb = new JComboBox(favourites.toArray()); This works fine and I can select each option and carry out the selected statements I need to do. However, when I wish to update the JComboBox , it does not update on my GUI. In another method I call: favourites.add("10 + 4"); jcb.revalidate(