Skip to content

Instantly share code, notes, and snippets.

@fanjavaid
Last active December 12, 2015 01:08
Show Gist options
  • Save fanjavaid/4689147 to your computer and use it in GitHub Desktop.
Save fanjavaid/4689147 to your computer and use it in GitHub Desktop.
public class DoctorComboBoxListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
Doctor doctor = (Doctor) MainFrame.cmbDoctor.getSelectedItem();
System.out.println(doctor.getId());
}
}
public MainFrame() {
initComponents();
disableAll();
// Make fullscren startup
setExtendedState(MainFrame.MAXIMIZED_BOTH);
getPatientData();
getDoctorData();
cmbDoctor.addActionListener(new DoctorComboBoxListener());
visitDataTable();
getCaptureImgData(panelCapture);
}
public void getDoctorData() {
DoctorService doctorService = new DoctorService();
List<Doctor> list = doctorService.selectAll();
cmbDoctor.removeAllItems();
for (Doctor doctor : list) {
cmbDoctor.addItem(doctor);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment