33 lines
833 B
Java
33 lines
833 B
Java
package de.ph87.electro;
|
|
|
|
import de.ph87.electro.circuit.CircuitPanel;
|
|
|
|
import javax.swing.*;
|
|
import java.awt.*;
|
|
|
|
public class Window extends JFrame {
|
|
|
|
public Window() {
|
|
add(new CircuitPanel());
|
|
|
|
positionOnRightMostScreen();
|
|
setDefaultCloseOperation(EXIT_ON_CLOSE);
|
|
setPreferredSize(new Dimension(1200, 900));
|
|
setExtendedState(MAXIMIZED_BOTH);
|
|
pack();
|
|
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();
|
|
}
|
|
|
|
}
|