Here you can find the source of showConfirmation(Component parent, String message)
Parameter | Description |
---|---|
parent | The parent of the dialog. |
message | The message to be displayed |
public static boolean showConfirmation(Component parent, String message)
//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; } }