position on right most screen
This commit is contained in:
parent
91e7d2541a
commit
510a3ec977
@ -10,6 +10,7 @@ public class Window extends JFrame {
|
||||
public Window() {
|
||||
add(new CircuitPanel());
|
||||
|
||||
positionOnRightMostScreen();
|
||||
setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
setPreferredSize(new Dimension(1200, 900));
|
||||
setExtendedState(MAXIMIZED_BOTH);
|
||||
@ -17,6 +18,13 @@ public class Window extends JFrame {
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
private void positionOnRightMostScreen() {
|
||||
final GraphicsDevice[] screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
|
||||
final GraphicsDevice thirdScreen = screens[screens.length - 1];
|
||||
final Rectangle screenBounds = thirdScreen.getDefaultConfiguration().getBounds();
|
||||
setLocation(screenBounds.x, screenBounds.y);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Window();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user