Here you can find the source of showMessage(final String msg, Component parent)
public static void showMessage(final String msg, Component parent)
//package com.java2s; // LICENSE: This file is distributed under the BSD license. import java.awt.Component; import javax.swing.JOptionPane; public class Main { public static void showMessage(final String msg) { JOptionPane.showMessageDialog(null, msg); }//from w ww .j a v a 2 s . co m public static void showMessage(final String msg, Component parent) { JOptionPane.showMessageDialog(parent, msg); } }