. Import java.awt *; public class GetScreenSize {public static void main (String [] str) {Toolkit toolkit = Toolkit.getDefaultToolkit (); Dimension scrnsize = toolkit.getScreenSize (); System.out.println ( "Screen size: " Scrnsize.width " * " scRnsize.height);}}
My computer (generally doing this resolution) Output: Screen Size: 1024 * 768
With this method, you can do a lot of screen positioning.