Here you can find the source of showError(String msg, String title)
public static void showError(String msg, String title)
//package com.java2s; //License from project: Apache License import javax.swing.*; public class Main { public static void showError(String msg, String title) { JDialog dialog = new JDialog(); dialog.setAlwaysOnTop(true);//from w ww.ja v a 2 s . c o m JOptionPane.showMessageDialog(dialog, msg, title, JOptionPane.ERROR_MESSAGE); } }