I'd like to know how to trigger different events using the same button. What I wanted was for the next click to give jButton1.setText("Créditos");
and return to btnGerar.setVisible(true);
The idea is that when I click on "Credits", it would drop everything and only my name would appear, and after I clicked back (it would be the same button), it would appear the other menus back.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
pnBusca.setVisible(false);
pnOpcao.setVisible(false);
btnGerar.setVisible(false);
jButton1.setText(" Voltar ");
}