Reputation: 2173
I'd like to position a JDialog nearby it's parent as showed in this picture:
How can I do that?
Thanks
Upvotes: 0
Views: 107
Reputation: 35011
An even easier way to do it to just reference the parent once:
Upvotes: 1
Reputation:
You could do:
JDialog.setLocation(parent.getX() + parent.getWidth(), parent.getY() + parent.getHeight() - (parent.getHeight() / 2 + JDialog.getHeight() / 2));
Upvotes: 3