Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.awt.Component;

import javax.swing.JOptionPane;

public class Main {
    /**
     * Displays a yes/no question to the user.
     * 
     * @param parent the parent <code>Component</code>
     * @param message the message to display
     * @return <code>true</code> if the user pressed 'yes'
     */
    public static boolean displayYesNoPrompt(Component parent, String message) {
        return (JOptionPane.YES_OPTION == JOptionPane.showOptionDialog(parent, message, null,
                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null));
    }
}