Here you can find the source of contChoose(final Component parent, final String title, final String message, final String noContMsg, boolean cont, boolean error)
private static int contChoose(final Component parent, final String title, final String message, final String noContMsg, boolean cont, boolean error)
//package com.java2s; /**// w w w . j a va 2 s . c o m * This file is part of the Paxle project. * Visit http://www.paxle.net for more information. * Copyright 2007-2010 the original author or authors. * * Licensed under the terms of the Common Public License 1.0 ("CPL 1.0"). * Any use, reproduction or distribution of this program constitutes the recipient's acceptance of this agreement. * The full license text is available under http://www.opensource.org/licenses/cpl1.0.txt * or in the file LICENSE.txt in the root directory of the Paxle distribution. * * Unless required by applicable law or agreed to in writing, this software is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import java.awt.Component; import javax.swing.JOptionPane; public class Main { private static int contChoose(final Component parent, final String title, final String message, final String noContMsg, boolean cont, boolean error) { final int optionType = (error) ? JOptionPane.ERROR_MESSAGE : JOptionPane.WARNING_MESSAGE; if (cont) { return JOptionPane.showConfirmDialog(parent, message, title, JOptionPane.YES_NO_CANCEL_OPTION, optionType); } else { JOptionPane.showMessageDialog(parent, noContMsg, title, optionType); return -1; } } }