Java JOptionPane Message queryBoolean(String message)

Here you can find the source of queryBoolean(String message)

Description

Queries the User for a Boolean value.

License

Open Source License

Parameter

Parameter Description
message a parameter

Exception

Parameter Description
Exception an exception

Return

the chosen boolean

Declaration

public static boolean queryBoolean(String message) throws Exception 

Method Source Code

//package com.java2s;
/*// w w w  .  j  a  v  a 2s.  c  o  m
 * Copyright (C) 2010-2014  Andreas Maier
 * CONRAD is developed as an Open Source project under the GNU General Public License (GPL).
 */

import javax.swing.JOptionPane;

public class Main {
    /**
     * Queries the User for a Boolean value.
     * @param message
     * @return the chosen boolean
     * @throws Exception
     */
    public static boolean queryBoolean(String message) throws Exception {
        int revan = JOptionPane.showConfirmDialog(null, message);
        return (revan == JOptionPane.YES_OPTION);
    }
}

Related

  1. popup(Component parent, String message, String title)
  2. popupMessage(String message)
  3. popupMessage(String title, String message)
  4. promptForFloat(Component parentComponent, String message, String title, float oldValue)
  5. promptForString(Component parentComponent, String message, String title, String oldValue)
  6. queryDouble(String message, double initialValue)
  7. queryInt(String message, int initialValue)
  8. requestPassword(String titulo, String msg)
  9. select(String[] selList, String msg)