Java JOptionPane Confirmation confirmationPrompt(String msg, String title, Component parent)

Here you can find the source of confirmationPrompt(String msg, String title, Component parent)

Description

confirmation Prompt

License

Apache License

Declaration

public static boolean confirmationPrompt(String msg, String title,
            Component parent) 

Method Source Code

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

import java.awt.Component;

import javax.swing.JOptionPane;

public class Main {
    public static boolean confirmationPrompt(String msg, String title,
            Component parent) {//from   w w  w .  j a va 2  s.  c o m
        Object[] options = { "Yes", "No" };
        int n = JOptionPane.showOptionDialog(parent, msg, title,
                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,
                null, options, options[1]);
        if (n == 0) {
            return true;
        } else {
            return false;
        }
    }
}

Related

  1. confirm(String msg)
  2. confirm(String title, Object message, JComponent parent)
  3. confirmAction(Component comp, String title, String msg)
  4. confirmarEliminar(Component component, String titulo, String mensaje)
  5. confirmationBox(String msg, String title)
  6. confirmChangeReference(boolean isChangingProject)
  7. confirmDialog(Component owner, String title, String message)
  8. confirmDialog(String msg, String title)
  9. confirmDialogWorker(Component owner, String title, String message, ModalityType modalityType, int option)