Here you can find the source of noTo(String message)
Parameter | Description |
---|---|
message | the message to show. |
public static boolean noTo(String message)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009-2014 Black Rook Software * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html ******************************************************************************/ import java.awt.Component; import javax.swing.JOptionPane; public class Main { /**//www .ja va 2s. com * Displays a confirmation window asking a user a yes or no question. * This is a convenience method for code readability, and is completely * equivalent to !yesTo(message). * @param message the message to show. * @return true if "no" was clicked. false otherwise. */ public static boolean noTo(String message) { return !yesTo(message); } /** * Displays a confirmation window asking a user a yes or no question. * This is a convenience method for code readability, and is completely * equivalent to !yesTo(message,parent). * @param message the message to show. * @param parent Parent component of this dialog. * @return true if "no" was clicked. false otherwise. */ public static boolean noTo(String message, Component parent) { return !yesTo(message, parent); } /** * Displays a confirmation window asking a user a yes or no question. * @param message the message to show. * @return true if "yes" was clicked. false otherwise. */ public static boolean yesTo(String message) { return yesTo(message, null); } /** * Displays a confirmation window asking a user a yes or no question. * @param message the message to show. * @param parent Parent component of this dialog. * @return true if "yes" was clicked. false otherwise. */ public static boolean yesTo(String message, Component parent) { int c = JOptionPane.showConfirmDialog(parent, message, "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); boolean out = c == JOptionPane.YES_OPTION; return out; } }