Java JOptionPane Confirmation confirm(String message)

Here you can find the source of confirm(String message)

Description

confirm

License

Apache License

Declaration

public static boolean confirm(String message) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.Frame;

import javax.swing.JOptionPane;

public class Main {
    public static boolean confirm(String message) {

        //      Custom button text
        Object[] options = { "Si", "No" };

        int n = JOptionPane.showOptionDialog(new Frame(), message, "Confirmar", JOptionPane.YES_NO_OPTION,
                JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
        return n == 0;
    }/*from   ww w .  j  a v  a2s  . c  o  m*/
}

Related

  1. askConfirmation(final Window aWindow, final String aMessage, final String aTitle)
  2. confirm(Component component, String title, String msg)
  3. confirm(final Component component, final String title, final String message)
  4. confirm(String message)
  5. confirm(String message, boolean typeYesNo)
  6. confirm(String message, String title)
  7. confirm(String msg)
  8. confirm(String title, Object message, JComponent parent)