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();
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();
//将屏幕上的点转化为相对于Component c的坐标点
SwingUtilities.convertPointFromScreen(Point p, Component c);//将相对于Component c的点转化为屏幕上的坐标点
SwingUtilities.convertPointToScreen(Point p, Component c);