JOptionPane confirm Ok Cancel Dialog - Java Swing

Java examples for Swing:JOptionPane

Description

JOptionPane confirm Ok Cancel Dialog

Demo Code


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

public class Main {
    public static boolean confirmOkCancel(JFrame root, String text) {
        return JOptionPane.showConfirmDialog(root, text, "Confirm",
                JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION;
    }/*w  ww  . jav  a2  s  .  com*/
}

Related Tutorials