Java JOptionPane Confirmation showConfirmation(Component parent, String message)

Here you can find the source of showConfirmation(Component parent, String message)

Description

Show a confirmation dialog.

License

Open Source License

Parameter

Parameter Description
parent The parent of the dialog.
message The message to be displayed

Declaration

public static boolean showConfirmation(Component parent, String message) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Component;

import javax.swing.JOptionPane;

public class Main {
    /**//w  ww  .j a va2  s. co  m
     * Show a confirmation dialog.
     * 
     * @param parent
     *            The parent of the dialog.
     * @param message
     *            The message to be displayed
     */
    public static boolean showConfirmation(Component parent, String message) {
        boolean confirmed = false;
        if (JOptionPane.showConfirmDialog(parent, message) == JOptionPane.YES_OPTION) {
            confirmed = true;
        }
        return confirmed;
    }
}

Related

  1. quitConfirmed(Component parent, String message)
  2. retrieveUserConfirmation(String title, String message)
  3. showConfirm(final Component rootComponent, final String message, final String title)
  4. showConfirm(String message)
  5. showConfirmation(Component component, String message)
  6. showConfirmation(String msg)
  7. showConfirmationDialog(Component parent, String message)
  8. showConfirmationDialog(String title, String question)
  9. showConfirmDialog(Component parentComponent, Object message, String title)