I'm creating a program with MVC rules in Java and would like to know how to create an Event in a JLabel
when I click on it with the mouse.
For example, for buttons I do this:
View class:
void addLogarListener(ActionListener cal) {
btnLogar.addActionListener(cal);
}
Controller class:
view.addLogarListener(new LogarListener());
//===================================
class LogarListener implements ActionListener {
public void actionPerformed(ActionEvent evento) {
//Comandos
}
}