java.awt
类 PointerInfo

java.lang.Object
  继承者 java.awt.PointerInfo

public class PointerInfo
   
   
   
     
extends Object

描述指针位置的类。它提供指针所在的 GraphicsDevice,以及表示指针坐标的 Point

此类的实例应该通过 MouseInfo.getPointerInfo() 来获得。PointerInfo 实例不随鼠标的移动而动态更新。为了获取更新后的位置,必须再次调用 MouseInfo.getPointerInfo()

从以下版本开始:
1.5
另请参见:
MouseInfo.getPointerInfo()

方法摘要
 GraphicsDevicegetDevice()
          返回在创建此 PointerInfo 时鼠标指针所在的 GraphicsDevice
 PointgetLocation()
          返回在屏幕上表示指针坐标的 Point
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

getDevice

public GraphicsDevice getDevice()
返回在创建此 PointerInfo 时鼠标指针所在的 GraphicsDevice

返回:
与指针对应的 GraphicsDevice
从以下版本开始:
1.5

getLocation

public Point getLocation()
返回在屏幕上表示指针坐标的 Point。有关多屏幕系统坐标计算的更多信息,请参见 MouseInfo.getPointerInfo()

返回:
鼠标指针的坐标
从以下版本开始:
1.5
另请参见:
MouseInfo, MouseInfo.getPointerInfo()