Java JOptionPane Confirmation getConfirmation(Component parent, String str)

Here you can find the source of getConfirmation(Component parent, String str)

Description

Get user confirmation.

License

Open Source License

Declaration

public static boolean getConfirmation(Component parent, String str) 

Method Source Code

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

import java.awt.*;
import javax.swing.*;

public class Main {
    /**//  w  w  w  . j  ava2s .  com
     * Get user confirmation.
     */
    public static boolean getConfirmation(Component parent, String str) {

        int res = JOptionPane.showConfirmDialog(parent, str,
                "Confirmation", JOptionPane.YES_NO_OPTION,
                JOptionPane.QUESTION_MESSAGE);

        return (res == JOptionPane.YES_OPTION);
    }
}

Related

  1. ConfirmMessage(String strMsg)
  2. confirmUserChoiceWithCustomOptions(final Component sourceComponent, final String question, final String defaultOption, final String... options)
  3. confirmWindow(String title, String message)
  4. displayConfirm(Component parent, String message, String title, int optionType, int messageType)
  5. displayConfirmPane(String desc, String title)
  6. getConfirmation(Component parent, String str)
  7. getUserConfirmation(Component cp, String message)
  8. getUserConfirmation(String arg1)
  9. listConfirm(Component comp, String title, String message, Object[] listModel)