1
I have a college project to make a system of any category that, in this case, I chose a medical system and had something I didn’t quite understand about what the implementation would be like:
I have a JInternalFrame
called Medical record with various text fields for information and buttons like Save Registration, Delete Registration etc....
A class called MedicoListener
where all class actions would be implemented CadastroMedicos
in a single ActionListener
, where he would see which button was pressed and perform such action,).
How would the correct implementation of this?
Follows the Medicolistener class:
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
}
What don’t you understand? How it works to event orientation, how to separate operations in the same actionPerformed, the logic of a record-saving and deletion algorithm, or all the above?
– Giuliana Bezerra
How’s your class Medical records?
– user28595
@Giuliana I didn’t understand how to separate actions in actionPerformed within the class I quoted
– L. Maier
@diegofm The Registration class contains the Jframe for the user to fill in
– L. Maier
So, can you add how it is? Or the chunk named after the variables of the buttons you need to filter.
– user28595
@diegofm So, on this screen I have Jbuttonnovo, Jbuttonsalvar and Jbuttonexcluir, to facilitate the exemplification let’s assume that I have only the fields code and name for the register...
– L. Maier