Sorry, couldn’t let this one pass…
This one will get screen resolution for you.
import java.awt
gd=java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
width = gd.getDisplayMode().getWidth()
height = gd.getDisplayMode().getHeight()