Using JOptionPane to display multiple lines in a dialog box in java

The programs presented thus far display output in the command window. Many apps use windows or dialog boxes (also called dialogs) to display output. Web browsers such as Chrome, Firefox, Internet Explorer, Safari and Opera display web pages in their own windows. E-mail programs allow you to type and read messages in a window. Typically, dialog boxes are windows in which programs display important messages to users. Class JOptionPane provides prebuilt dialog boxes that enable programs to display windows containing messages—such windows are called message dialogs.

Java: Multiple lines of text using JOptionPane.showInputDialog

/*
 *       Filename:  Dialog1.java
 *
 *    Description:  3.17 - Using JOptionPane to display multiple lines in a
 *                  dialog box.
 *
 *  @Author:  Bilal Tahir Khan Meo
 *  Website: https://codeblah.com
 *
 * =====================================================================================
 */
import javax.swing.JOptionPane;

public class Dialog1{
    public static void main(String[] args){
        JOptionPane.showMessageDialog(null, "Welcome\nto\nJava");
    }
}