Here you can find the source of errMsg(final Component owner, final String msg, final Throwable e)
Parameter | Description |
---|---|
owner | the owner of the message, or null |
msg | the message to display, or null |
e | the exception object describing the error, or null |
public static void errMsg(final Component owner, final String msg, final Throwable e)
//package com.java2s; /*//from w w w . j ava2s .c o m * SimplyHTML, a word processor based on Java, HTML and CSS * Copyright (C) 2002 Ulrich Hilger * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ import java.awt.Component; import javax.swing.JOptionPane; public class Main { private static final String ERR_TITLE = "Error"; /** * show an error message and print a stack trace to the console if * in development mode (DEV_MODE = true) * * @param owner the owner of the message, or null * @param msg the message to display, or null * @param e the exception object describing the error, or null */ public static void errMsg(final Component owner, final String msg, final Throwable e) { if (e != null) { e.printStackTrace(); } if (msg != null) { JOptionPane.showMessageDialog(owner, msg, ERR_TITLE, JOptionPane.ERROR_MESSAGE); } } }