I want to make JOptionPane.showMessageDialog
message appear
For example this will display the message at the centre of the JFrame provided as argument thisFrame
JOptionPane.showMessageDialog(thisFrame, "Your message.");
And this will display the message at the centre of the screen irrelative to any JFrame.
JOptionPane.showMessageDialog(null, "Your message.");
what I want is to set the location of the message any place I want
what I want is to set the location of the message relative to the JFrame (not at the centre of the JFrame)
How?
What you need is
final JOptionPane pane = new JOptionPane("Hello");
final JDialog d = pane.createDialog((JFrame)null, "Title");
d.setLocation(10,10);
d.setVisible(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With