package com.dw.swing.lib;

import javax.swing.JOptionPane;

public class MessageBox {
	
	public MessageBox() {
		
	}

	public static void show(String infoMessage, String titleBar)
    {
        JOptionPane.showMessageDialog(null, infoMessage, titleBar, JOptionPane.INFORMATION_MESSAGE);
    }
}

package com.dw.swing.lib;

import javax.swing.JOptionPane;

public class MessageBox {
	
	public MessageBox() {
		
	}

	public static void show(String infoMessage, String titleBar)
    {
        JOptionPane.showMessageDialog(null, infoMessage, titleBar, JOptionPane.INFORMATION_MESSAGE);
    }
	
	public static void warning(String infoMessage, String titleBar)
    {
        JOptionPane.showMessageDialog(null, infoMessage, titleBar, JOptionPane.WARNING_MESSAGE);
    }
	
	public static void error(String infoMessage, String titleBar)
    {
        JOptionPane.showMessageDialog(null, infoMessage, titleBar, JOptionPane.ERROR_MESSAGE);
    }
}

add MessageBox for warning and error