+ 1

JOptionPane

JOptionPane.showMessageDialog(null,"the sum is "+sum,"Answer",JOptionPane.PLAIN_MESSAGE); // what is the meaning of "JOptionPane.PLAIN_MESSAGE"? is it a kind of object?

8th Aug 2020, 7:41 AM
Zhengrong Yan
Zhengrong Yan - avatar
2 Respuestas
+ 1
Good question. PLAIN_MESSAGE is a static variable of JOptionPane class. Static variables are variables belonging to a class rather than an object. They can be called directly on the class. In this case PLAIN_MESSAGE holds an integer value which indicates to the showMessageDialog that the dialog is a plain message.
8th Aug 2020, 8:13 AM
Ore
Ore - avatar
0
it is the constant with meaning: "No icon is used". public static final int PLAIN_MESSAGE
8th Aug 2020, 12:25 PM
zemiak