2014-08-30 84 views
0

位置的JDialog我想定位一个JDialog附近它的父在这张照片显示:附近其父

enter image description here

我怎么能这样做?

感谢

回答

2

你可以这样做:

JDialog.setLocation(parent.getX() + parent.getWidth(), parent.getY() + parent.getHeight() - (parent.getHeight()/2 + JDialog.getHeight()/2));