Java JOptionPane Error simpleError(Exception e, Component parent)

Here you can find the source of simpleError(Exception e, Component parent)

Description

simple Error

License

Open Source License

Declaration

public static void simpleError(Exception e, Component parent) 

Method Source Code


//package com.java2s;
/*// ww w  .j  av  a  2  s .  c  om
 * Copyright ? 2014 - 2016 | Wurst-Imperium | All rights reserved.
 * 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import java.awt.Component;

import java.io.PrintWriter;
import java.io.StringWriter;

import javax.swing.JOptionPane;

public class Main {
    public static void simpleError(Exception e, Component parent) {
        StringWriter writer = new StringWriter();
        e.printStackTrace(new PrintWriter(writer));
        String message = writer.toString();
        JOptionPane.showMessageDialog(parent, message, "Error", JOptionPane.ERROR_MESSAGE);
    }
}

Related

  1. showErrorPane(String errorMessage, Exception e)
  2. showErrorPanel(Component parent, String aS, Icon icon)
  3. showNoMacFoundError()
  4. showPrettyErrorPane(Component caller, String msg)
  5. showSettopLockError(String macAddress)