Class YesNoDialog

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

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).
Since:
0.11.0
Author:
Marco Schmidt
See Also:
  • Field Details

  • Constructor Details

    • 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.
      Parameters:
      owner - the frame that owns this modal dialog
      strings - the String resources
      titleIndex - the index into the String resource of the title text
      questionIndex - the index into the String resource of the question text
      includeCancel - determines whether a third button 'Cancel' will be included
  • Method Details

    • 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).
      Specified by:
      actionPerformed in interface ActionListener
    • getResult

      public int getResult()
      Returns one of the RESULT_xyz constants of this class.
      Returns:
      the RESULT constant of the button which the user has chosen