Java tutorial
//package com.java2s; //License from project: Open Source License import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.Point; public class Main { public static boolean isPointOnScreen(Point p) { GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); for (GraphicsDevice device : devices) { if (device.getDefaultConfiguration().getBounds().contains(p)) { return true; } } return false; } }