If I choose a city FROM: JComboBox then it shouldn’t appear in TO: combo box. How can I code the ActionListener of this action listener? Screenshot Code: Answer I reworked your code to get away from static. You only need one list of cities for your from and to JComboBoxes. You use an ActionListener to listen for changes in the