
import java.io.IOException;
import javax.swing.JOptionPane;

public class ConfirmBox {
	public static void main (String[] args) {

		JOptionPane vb = new JOptionPane ();
                String title;
                String message;

		if (args.length >= 1) {
			message = args[0];
		} else {
			message = " ";
		}

		if (args.length >= 2) {
			title = args[1];
		} else {
			title = "Confirm before proceeding";
		}


		int choice = vb.showConfirmDialog(null,message,title, JOptionPane.YES_NO_OPTION);

		try {
			if (choice == JOptionPane.YES_OPTION) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
                        }
			System.exit(1);
		} catch (Exception E) {
			System.out.println("Error");
		}
	}
}
