Dialog with a Custom Icon

we’ll try a message dialog with a custom icon

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

public class JOptionDialog {
	public static void main(String[] args) {
	JOptionPane.showMessageDialog(null, "Have a nice day.", "Example 3",
		JOptionPane.INFORMATION_MESSAGE, new ImageIcon("images/smile.gif"));

	}
}