JOptionPane showMessageDialog(QUESTION_MESSAGE)

showMessageDialog( Component parent, Object message, String title, QUESTION_MESSAGE) The first argument is the parent for the dialog that is used to position the dialog. The second argument specifies what is to be displayed in addition to the default OK button. Third argument specifies by the title. The fourth argument, messageType, can be: QUESTION_MESSAGE These static JOptionPane fields … Read more…

JOptionPane showMessageDialog(PLAIN_MESSAGE)

showMessageDialog( Component parent, Object message, String title, PLAIN_MESSAGE) The first argument is the parent for the dialog that is used to position the dialog. The second argument specifies what is to be displayed in addition to the default OK button. This can be a String object specifying the message.Third argument specifies by the title. The fourth … Read more…

JOptionPane showMessageDialog(INFORMATION_MESSAGE)

showMessageDialog( Component parent, Object message, String title, INFORMATION_MESSAGE) The first argument is the parent for the dialog that is used to position the dialog. The second argument specifies what is to be displayed in addition to the default OK button. Third argument specifies by the title. The fourth argument, messageType, can be: INFORMATION_MESSAGE These static … Read more…

JOptionPane showMessageDialog (ERROR_MESSAGE)

showMessageDialog( Component parent, Object message, String title, ERROR_MESSAGE) The first argument is the parent for the dialog that is used to position the dialog.The second argument specifies what is to be displayed in addition to the default OK button. Third argument specifies by the title. The fourth argument, messageType, can be : ERROR_MESSAGE These static … Read more…

JOptionPane showMessageDialog

Introduction : The JOptionPane class in the javax.swing package. A class used to create any number of different types of dialog boxes, including attention dialogs, yes/no dialogs, and input dialogs. showMessageDialog () : showMessageDialog( Component parent, Object message) This displays a modal dialog with the default title “Message”. The first argument is the parent for … Read more…

Java-new String vs String literals

new String vs String literals When you create String object using new operator, it always create a new object in heap(one of memory section). On the other hand, if you create object using string literal, it may return an existing object from String pool(one of memory section), if it’s already exists. Otherwise it will create a … Read more…