Here you can find the source of confirmAction(Component comp, String title, String msg)
public static boolean confirmAction(Component comp, String title, String msg)
//package com.java2s; //License from project: Open Source License import java.awt.Component; import javax.swing.JOptionPane; public class Main { public static boolean confirmAction(Component comp, String title, String msg) { int decision = JOptionPane.showConfirmDialog(comp, msg, title, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (decision == JOptionPane.NO_OPTION) { return false; }//www . java 2 s. com return true; } }