Skip to content

Instantly share code, notes, and snippets.

View fanjavaid's full-sized avatar
:electron:

Fandi Akhmad fanjavaid

:electron:
View GitHub Profile
public class DoctorComboBoxListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
Doctor doctor = (Doctor) MainFrame.cmbDoctor.getSelectedItem();
System.out.println(doctor.getId());
}
}
public void getDoctorData() {
DoctorService doctorService = new DoctorService();
List<Doctor> list = doctorService.selectAll();
Vector vecModel = new Vector();
for (Doctor doctor : list) {
String name = doctor.getFirstname()+" "+doctor.getLastname();
int id = doctor.getId();
vecModel.addElement(new Doctor(id, name));