O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Components and Cursors

The AWT supports the ability to set a component's cursor; to set the cursor for a component, you pass the component's setCursor method an instance of a Cursor. The Cursor class comes with a set of predefined cursors, which can be accessed by invoking Cursor.getPredefinedCursor(), which expects to be passed one of the integer constants listed in Table 11-6.

Table 11-6. Cursor Constants for Predefined Cursors
Cursor
DEFAULT_CURSOR
CROSSHAIR_CURSOR
TEXT_CURSOR
WAIT_CURSOR
SW_RESIZE_CURSOR
SE_RESIZE_CURSOR
NW_RESIZE_CURSOR
NE_RESIZE_CURSOR
N_RESIZE_CURSOR
S_RESIZE_CURSOR
W_RESIZE_CURSOR
E_RESIZE_CURSOR
HAND_CURSOR
MOVE_CURSOR

Figure 11-2 shows an applet equipped with a choice whose items represent predefined cursors. When a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required