Answers for "java windowbuilder launch on second monitor"

0

java windowbuilder launch on second monitor

public static void showOnScreen( int screen, JFrame frame ) {
	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
	GraphicsDevice[] gs = ge.getScreenDevices();
	
	if(screen > -1 && screen < gs.length) {
	    gs[screen].setFullScreenWindow(frame);
	}else if(gs.length > 0) {
	    gs[0].setFullScreenWindow(frame);
	}else {
	    throw new RuntimeException("No Screens Found");
	}
}
Posted by: Guest on July-07-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language