How to Show the Message Dialog in Java


In this example, we can learn how to show the message dialog in Java.

Source Code

package com.beginner.examples;

import javax.swing.JOptionPane;

public class MessageDialogExample {

    public static void main(String[] args){
        JOptionPane.showMessageDialog(null, "Message Dialog");
        System.out.println("Done!");
    }
}

Output:

Done!

References

Imported packages in Java documentation:

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments