Here you can find the source of errorMessage(Component parent, Throwable t)
Parameter | Description |
---|---|
parent | the parent component |
t | the exception |
public static void errorMessage(Component parent, Throwable t)
//package com.java2s; /*//from w ww. j av a 2s. co m * Copyright 2010-2012 The Advance EU 7th Framework project consortium * * This file is part of Advance. * * Advance is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * Advance 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with Advance. If not, see * <http://www.gnu.org/licenses/>. * */ import java.awt.Component; import javax.swing.JOptionPane; public class Main { /** * Display an error dialog with the message. * @param parent the parent component * @param text the message */ public static void errorMessage(Component parent, String text) { JOptionPane.showMessageDialog(parent, text, "Error", JOptionPane.ERROR_MESSAGE); } /** * Display an error dialog with the exception. * @param parent the parent component * @param t the exception */ public static void errorMessage(Component parent, Throwable t) { t.printStackTrace(); JOptionPane.showMessageDialog(parent, t.toString(), "Error", JOptionPane.ERROR_MESSAGE); } }