I want confirmation messages from my system to behave with the default value of "no". I did this by doing this:
private void jButtonActionPerformed(java.awt.event.ActionEvent evt) {
Object[] options = {"Yes", "No"};
JOptionPane.showOptionDialog(rootPane, "Deseja Excluir o Usuário?",
"Titulo", 0, 3, null, options, options[1]);
I just want to create a method to reuse this snippet of code and I'm not getting it. Do I have to override the showOptionDialog
method of java?
I want to pass as parameter the message to be displayed and I want it to return the option selected by the user.
How would you do that?