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 ‘ItemEvent’

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 →

AWT Choice Control Explained

AWT Choice Control Example

Top portion of the Frame window has the AWT Choice Control. There are two Text fields in the Frame. The first one takes a string and adds it to the Choice Control via Add button click. The next text field is used to display the selected text of the Choice Control. Moreover, the Remove button click will use this text field to delete an item in the Choice.

Continue Reading →