Here you can find the source of confirm(String message)
public static boolean confirm(String message)
//package com.java2s; //License from project: Apache License import java.awt.Frame; import javax.swing.JOptionPane; public class Main { public static boolean confirm(String message) { // Custom button text Object[] options = { "Si", "No" }; int n = JOptionPane.showOptionDialog(new Frame(), message, "Confirmar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]); return n == 0; }/*from ww w . j a v a2s . c o m*/ }