if (cursor == null) {
return;
}
try {
final HardwareCursorImage cursImage = cursor.getImage(20, 20);
if ((cursImage != null) && (this.cursorImage != cursImage)) {
hideCursor();
cursorArea.setSize(cursImage.getWidth(), cursImage.getHeight());
if (cursorImage != null) {
int newX =
(int) (cursorArea.getX() + cursorImage.getHotSpotX() - cursImage
.getHotSpotX());
int newY =
(int) (cursorArea.getY() + cursorImage.getHotSpotY() - cursImage
.getHotSpotY());
cursorArea.setLocation(newX, newY);
}
this.cursorImage = cursImage;