I created a combo box:
JComboBox comboBox = new JComboBox();
comboBox.setModel(new DefaultComboBoxModel(new String[] {"<Select a Team>", "X", "Y", "Z"}));
When I invoke System.out.println(comboBox.getSelectedItem().toString());
in order to see the selected item, I only see <Select a Team> .
How can I print the value of the combo box each time I change it's value? (I tried to search for how to use a listener or callback functions but didn't understand how to implement it for my goals).