Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

Tag Archive for ‘getStateChange()’

Swing JComboBox & ItemListener

Java Swing - JComboBox Example

The example contains two JLabels, two JTextFields and a JComboBox. Note, the above screen shows Java Swing JComboBox as an editable type. When the user selects an item in the combo box, we show that in the first text box. We also show the past selected item in the Deselected JTextField. A combo box can show only one item once the drop-down is collapsed. So when the user picks an item, in combo box point of view, one item was selected by the user and one was de-selected (the previous one).

Continue Reading →