I want to make a simple Yes/No-Dialog. Quite simple actually of course:
int i = JOptionPane.showConfirmDialog(c, "Do you really want to delete file",
"JfD", JOptionPane.YES_NO_OPTION);
But now I want to have it position somewhere else than the center of the screen.
I tried to use another parent component than "this":
Frame c = new Frame();
c.setBounds(200, 200, 100, 100);
int i = JOptionPane.showConfirmDialog(c, "Do you really want to delete
file", "JfD", JOptionPane.YES_NO_OPTION);
This did not work. I also tried to create a new dialog:
final JOptionPane pane = new JOptionPane("Do you really want to delete
this file?", JOptionPane.PLAIN_MESSAGE, JOptionPane.YES_NO_OPTION);
final JDialog d = pane.createDialog("JavaFunctionsDatabase3");
d.setLocation(frameX+120, frameY+80);
d.setVisible(true);
int i = pane.getValue();
This positioned the dialog right, but I cannot get the right input, because here the dialog does not "wait" for the users input - so I get just an error from pane.getvalue(); bc it does not have any then.
I hope anybody has a solution, either to set the bounds of the first dialogs or to have the second one "wait" (that is alss needed because the following actions depend on the users choice).
Thank you very much for any help!