mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Set location of splash screen basing on the current screen device.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user