net.kolls.railworld
Class YesNoCancel

java.lang.Object
  extended by net.kolls.railworld.YesNoCancel

public class YesNoCancel
extends java.lang.Object

Displays a JOptionPane dialog with three buttons: yes, no, and cancel. However, the face of the buttons is given by the caller. The return values follow the usual JOptionPane constants of YES_OPTION, NO_OPTION, and CANCEL_OPTION.

Author:
Steve Kollmansberger

Constructor Summary
YesNoCancel()
           
 
Method Summary
static int showDialog(java.awt.Component parent, java.lang.String message, java.lang.String title, java.lang.String yes, java.lang.String no, java.lang.String cancel)
          Create a new dialog showing a yes, no, and cancel option with text specified by the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YesNoCancel

public YesNoCancel()
Method Detail

showDialog

public static int showDialog(java.awt.Component parent,
                             java.lang.String message,
                             java.lang.String title,
                             java.lang.String yes,
                             java.lang.String no,
                             java.lang.String cancel)
Create a new dialog showing a yes, no, and cancel option with text specified by the user.

Parameters:
parent - The parent frame
message - The message to display
title - Title of the dialog
yes - The text for the "yes" button
no - The text for the "no" button
cancel - The text for the "cancel" button
Returns:
A code indicating which button was selected; JOptionPane.YES_OPTION, JOptionPane.NO_OPTION, or JOptionPane.CANCEL_OPTION. If neither button is clicked, the cancel value is returned.
See Also:
JOptionPane