java windowbuilder launch on second monitor

Solutions on MaxInterview for java windowbuilder launch on second monitor by the best coders in the world

showing results for - "java windowbuilder launch on second monitor"
Lou
16 Apr 2018
1public static void showOnScreen( int screen, JFrame frame ) {
2	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
3	GraphicsDevice[] gs = ge.getScreenDevices();
4	
5	if(screen > -1 && screen < gs.length) {
6	    gs[screen].setFullScreenWindow(frame);
7	}else if(gs.length > 0) {
8	    gs[0].setFullScreenWindow(frame);
9	}else {
10	    throw new RuntimeException("No Screens Found");
11	}
12}