Here you can find the source of msg(int options, String title, String msg, String item, String sep)
Wrapper for JOptionPane with I18N support
Parameter | Description |
---|---|
options | the options to be shown in the dialog |
title | the title to be shown in the dialog |
msg | the message to be shown in the dialog |
item | a variable part to be shown before msg |
sep | a separator for msg and item (return or blank etc.) |
public static boolean msg(int options, String title, String msg, String item, String sep)
//package com.java2s; /*//from w w w . j a va 2 s . com * This file is part of the Scriba source distribution. This is free, open-source * software. For full licensing information, please see the LicensingInformation file * at the root level of the distribution. * * Copyright (c) 2006-2007 Kobrix Software, Inc. */ import javax.swing.JOptionPane; public class Main { /** * Show a message with options to choose from * * <p> * Wrapper for JOptionPane with I18N support * </p> * * @param options the options to be shown in the dialog * @param title the title to be shown in the dialog * @param msg the message to be shown in the dialog * @param item a variable part to be shown before msg * @param sep a separator for msg and item (return or blank etc.) * * @return true, if YES was chosen, false if not */ public static boolean msg(int options, String title, String msg, String item, String sep) { return (msgChoice(options, title, msg, item, sep) == JOptionPane.YES_OPTION); } /** * Show a message with options to choose from * * <p> * Wrapper for JOptionPane with I18N support * </p> * * @param options the options to be shown in the dialog * @param title the title to be shown in the dialog * @param msg the message to be shown in the dialog * @param item a variable part to be shown before msg * @param sep a separator for msg and item (return or blank etc.) * * @return the choice */ public static int msgChoice(int options, String title, String msg, String item, String sep) { String message = item + sep + msg; return JOptionPane.showConfirmDialog(null, message, title, options, JOptionPane.QUESTION_MESSAGE); } }