OptionDialog.java Source code

Java tutorial

Introduction

Here is the source code for OptionDialog.java

Source

import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class OptionDialog {

    public static void main(String argv[]) {
        if (JOptionPane.showConfirmDialog(new JFrame(), "Do you want to quit this application ?", "Title",
                JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
            System.exit(0);

    }
}