if you means the screen, you can get screen
size by call  Toolkit.getDefaultToolkit().getScreenSize();
Then in a mouse event, you can get current  mouse
position, Comparing both.if you mean a component. there is function
contains(int x, int y) can be used. this function
return true if point is inside, otherwise return 
false. MouseEvent.getX();
MouseEvent.getY();