Constructors of JOptionPane Class
Constructors |
Description |
---|---|
JOptionPane() |
This is the default constructor for JOptionPane.It is used to create a JOptionPane with no options and message. |
JOptionPane(Object message) |
It creates a message dialog with a specified message. |
JOptionPane(Object message, int messageType) |
It creates a message dialog with a specified message and its Type. |
JOptionPane(Object message, int messageType, int optionType) |
It helps us to create a dialog with a specified message, message type, and option type. |
Java JOptionPane
In Java, JOptionPane is a part of the Java Swing library. It helps us to create dialog boxes such as message dialogs, conformation dialogs, input dialogs, and options dialogs In this article, we are going to explore some constructors, methods, and some examples of JOptionPane.