I have a JComboBox that displays Name From database Patients_Details
public void ComboItem() {
chooser.removeAllItems();
chooser.addItem(\"Please Select...\");
Simply add an ActionListener
to the combo box. When actionPerformed
is called, you can look up the selected value and call what ever methods you need to.
For example:
chooser.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
Object selectedValue = chooser.getSelectedValue();
// carry on with what ever you need
}
});
Have a look at ...
For more details