JOptionPane confirm dialog - Java Swing

Java examples for Swing:JOptionPane

Description

JOptionPane confirm dialog

Demo Code


//package com.java2s;
import javax.swing.JOptionPane;

public class Main {
    public static boolean confirm(String title, String msg) {
        return JOptionPane.showConfirmDialog(null, msg, title,
                JOptionPane.OK_CANCEL_OPTION) == 0;
    }//  www . j a  va  2  s.  c  o m
}

Related Tutorials