I have several buttons and I would like to compare the text of the button clicked with a variable of type String
.
This without using this:
if (evento.getSource() == botaoXl) {
// Fazer isto...
} else if (evento.getSource() == botaoY) {
// Fazer aquilo...
}