Set location of splash screen basing on the current screen device.

This commit is contained in:
Denis Fokin
2014-02-19 17:20:02 +04:00
parent f56d570b1e
commit 3886bc21b5
@@ -78,7 +78,12 @@ public class Splash extends JDialog implements StartupProgress {
Dimension size = getPreferredSize();
setSize(size);
pack();
setLocationRelativeTo(null);
setLocationInTheCenterOfScreen();
}
private void setLocationInTheCenterOfScreen() {
Rectangle deviceBounds = getGraphicsConfiguration().getBounds();
setLocation((deviceBounds.width - getWidth()) / 2, (deviceBounds.height - getHeight()) / 2);
}
public Splash(ApplicationInfoEx info) {