3
I want my system’s confirmation messages to behave with the default value "no". I have achieved this by doing so:
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]);
Only I want to create a method to reuse this chunk of code and I’m not getting it. I have to override the method showOptionDialog
java?
I want to pass as parameter the message to be displayed and I want to return the option selected by the user.
How would you do that?