Here you can find the source of confirmationPrompt(String msg, String title, Component parent)
public static boolean confirmationPrompt(String msg, String title, Component parent)
//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; } } }