net.sourceforge.jiu.gui.awt.dialogs
Class YesNoDialog
Dialog
net.sourceforge.jiu.gui.awt.dialogs.YesNoDialog
- ActionListener
public class YesNoDialog
extends Dialog
implements ActionListener
A dialog that asks a question and offers a Yes and a No button
(and optionally a Cancel button).
YesNoDialog(Frame owner, Strings strings, int titleIndex, int questionIndex, boolean includeCancel) - Creates a new YesNoDialog object and shows it centered on the screen.
|
void | actionPerformed(ActionEvent e) - Hides (closes) this dialog if the OK button was source of the action event
(e.g.
|
int | getResult() - Returns one of the RESULT_xyz constants of this class.
|
RESULT_CANCEL
public static final int RESULT_CANCEL
Will be returned in
getResult()
if the CANCEL button was chosen.
RESULT_NO
public static final int RESULT_NO
Will be returned in
getResult()
if the NO button was chosen.
RESULT_YES
public static final int RESULT_YES
Will be returned in
getResult()
if the YES button was chosen.
cancel
private Button cancel
YesNoDialog
public YesNoDialog(Frame owner,
Strings strings,
int titleIndex,
int questionIndex,
boolean includeCancel)
Creates a new YesNoDialog object and shows it centered on the screen.
owner
- the frame that owns this modal dialogstrings
- the String resourcestitleIndex
- the index into the String resource of the title textquestionIndex
- the index into the String resource of the question textincludeCancel
- determines whether a third button 'Cancel' will be included
actionPerformed
public void actionPerformed(ActionEvent e)
Hides (closes) this dialog if the OK button was source of the action event
(e.g. if the button was pressed).
getResult
public int getResult()
Returns one of the RESULT_xyz constants of this class.
- the RESULT constant of the button which the user has chosen