How do I get the name of a button in a class that implements the MouseListener:
public class Viewer extends javax.swing.JFrame{
public Viewer() {
initComponents();
}
public void init(){
MouseListener ouvinte = new MouseListener();
btn00.addMouseListener(ouvinte);
}
}
public class MouseListener implements java.awt.event.MouseListener{
@Override
public void mouseClicked(MouseEvent me) {
Model modelo = new Model();
//Como consigo obter o nome do botão "btn00" nesta classe?
if(modelo.validarJogada(getName(), 1))
}
}
}