Java examples for Swing:Screen
is Point On Screen
//package com.java2s; 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; }//from w w w . j a va 2s . c om } return false; } }