i'm calculateing like this but i think it is not giveing exact value if i change the resolution of dispaly Dimension screen = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); int pixelPerInch=java.awt.Toolkit.getDefaultToolkit().getScreenResolution(); double height=screen.getHeight()/pixelPerInch; double width=screen.getWidth()/pixelPerInch; double x=Math.pow(height,2); double y=Math.pow(width,2); jLabel1.setText("Res"+screen.getHeight()+"X"+screen.getWidth()+"Pixel/Inch"+pixelPerInch+" "+x+" "+y+"="+Math.sqrt(x+y));