I have a college project to make a system of any category which in the case I chose a medical system and had something I did not quite understand about what the implementation would be like:
I have a JInternalFrame
called CadastroMedico with several text fields for the information and buttons like Save Registration, Delete Registration etc ...
I was asked to create a class called MedicoListener
where all actions of class CadastroMedicos
would be implemented in a single ActionListener
, where it would see which button was pressed and perform such action, and that's where I I did not get the thread (I have a Medical class with getters & setters).
How would the correct implementation of this be?
The MedicalListener class follows:
public class MedicoListener implements ActionListener {
Medico med = new Medico();
private CadastroMedico frame;
public MedicoListener(CadastroMedico frame){
this.frame = frame;
}
@Override
public void actionPerformed(ActionEvent e) {
//SALVAR
//EXCLUIR
}