Java JOptionPane Error errorMessage(Exception exceptionMsg, boolean quiet)

Here you can find the source of errorMessage(Exception exceptionMsg, boolean quiet)

Description

error Message

License

Open Source License

Declaration

public static void errorMessage(Exception exceptionMsg, boolean quiet) 

Method Source Code

//package com.java2s;

import javax.swing.JOptionPane;

public class Main {
    protected static String messagerHeader = "Database Manager Swing Error";

    protected static void errorMessage(String errorMessage) {

        /**//from   ww  w .  j  a  va 2 s  .  c  om
         * Display Jpanel Error messages any text Errors. Overloads
         * errorMessage(Exception exceptionMsg)
         */
        Object[] options = { "OK" };

        JOptionPane.showOptionDialog(null, errorMessage, messagerHeader, JOptionPane.DEFAULT_OPTION,
                JOptionPane.WARNING_MESSAGE, null, options, options[0]);

        // DatabaseManagerSwing.StatusMessage(READY_STATUS);
    }

    public static void errorMessage(Exception exceptionMsg) {
        errorMessage(exceptionMsg, false);
    }

    public static void errorMessage(Exception exceptionMsg, boolean quiet) {

        /**
         * Display Jpanel Error messages any SQL Errors. Overloads
         * errorMessage(String e)
         */
        Object[] options = { "OK", };

        JOptionPane.showOptionDialog(null, exceptionMsg, messagerHeader, JOptionPane.DEFAULT_OPTION,
                JOptionPane.ERROR_MESSAGE, null, options, options[0]);

        if (!quiet) {
            exceptionMsg.printStackTrace();
        }

        // DatabaseManagerSwing.StatusMessage(READY_STATUS);
    }
}

Related

  1. error(final Component component, final Object msg)
  2. error(String message, Component parent)
  3. error(String message, String title)
  4. errorMessage(Component component, String title, String message)
  5. errorMessage(Component parent, Throwable t)
  6. exibeMsgErro(String msg)
  7. getIconError()
  8. guiError(String errormsg, String errortitle)
  9. logErrorMessage(String msg)