Java JOptionPane Error guiError(String errormsg, String errortitle)

Here you can find the source of guiError(String errormsg, String errortitle)

Description

Create a gui dialog representing an error which occurred.

License

Open Source License

Parameter

Parameter Description
errormsg The error message to be shown with this dialog.
errortitle The title of the error message to be shown in the window.

Declaration

public static void guiError(String errormsg, String errortitle) 

Method Source Code


//package com.java2s;
/*/*from ww  w .j  a  v  a 2  s.co m*/
   Colored Trails
       
   Copyright (C) 2006, President and Fellows of Harvard College.  All Rights Reserved.
       
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.
       
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
       
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

import javax.swing.*;

public class Main {
    /**
     * Create a gui dialog representing an error which occurred.
     *
     * @param errormsg The error message to be shown with this dialog.
     */
    public static void guiError(String errormsg) {
        guiError(errormsg, "Error");
    }

    /**
     * Create a gui dialog representing an error which occurred.
     *
     * @param errormsg   The error message to be shown with this dialog.
     * @param errortitle The title of the error message to be shown in the
     *                   window.
     */
    public static void guiError(String errormsg, String errortitle) {

        JOptionPane.showMessageDialog(null, errormsg, errortitle, JOptionPane.ERROR_MESSAGE);
    }
}

Related

  1. errorMessage(Component component, String title, String message)
  2. errorMessage(Component parent, Throwable t)
  3. errorMessage(Exception exceptionMsg, boolean quiet)
  4. exibeMsgErro(String msg)
  5. getIconError()
  6. logErrorMessage(String msg)
  7. popupError(String s, Throwable e)
  8. printErrorMessageAndExit(String message)
  9. showAudioNotAvailableError(String macId)