We would like to know how to create error dialog with multiple lines of text with JOptionPane.
import javax.swing.JFrame; import javax.swing.JOptionPane; //from ww w. j a va 2 s .c o m public class Main { public static void main(String argv[]) { String message = "line\n" + "line 2\n" + "line 3"; JOptionPane.showMessageDialog(new JFrame(), message, "Dialog", JOptionPane.ERROR_MESSAGE); } }