l = new List();
l.setSize(250, 200);
l.setLocation(500, 250);
l.setVisible(true);
l.setFocusable(true);
M.add(l);//was M
l.setFont(new Font("sansserif", Font.BOLD, 15));//set the txt font n size
patientListTitle=new Label("PID: Patient's Name:");
patientListTitle.setSize(200, 50);
patientListTitle.setLocation(500, 200);
patientListTitle.setForeground(Color.BLACK);
patientListTitle.setBackground(Color.white);
patientListTitle.setVisible(true);
patientListTitle.setFocusable(true);
M.add(patientListTitle);//was M
Select.setSize(50, 25);
Select.setLocation(500, 580);
Select.setVisible(true);
Select.setFocusable(true);
M.add(Select);//was M
Select.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
System.out.println("Select Button clicked");
// ADD STUFF HERE :D
getIndexedItem=l.getItem(l.getSelectedIndex());
System.out.println(getIndexedItem);
try {
deletePatient(getIndexedItem, l.getSelectedIndex());
} catch (SQLException ex) {
Logger.getLogger(javaapplication2.class.getName()).log(Level.SEVERE, null, ex);
} catch (ClassNotFoundException ex) {
Logger.getLogger(javaapplication2.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
repaint();
try {
retrievePatient();
} catch (SQLException ex) {
Logger.getLogger(javaapplication2.class.getName()).log(Level.SEVERE, null, ex);
}
repaint();