Java – how to set the location of jooptionpane
•
Java
I'm creating this joptionpane
JOptionPane.showMessageDialog(this,"File was saved","Save",JOptionPane.INFORMATION_MESSAGE);
But my JFrame is big, so it is scrollable When I call this command, a window will be created in the lower right corner, and I can only see the title How can I change the position of this joptionpane?
Solution
According to API 1.6:
Therefore, there is no parameter to set the location of jooptionpane, but you can at least pass null as the first parameter to ensure that your jooptionpane is visible and centered
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码