Changing the Cursor

A component has a cursor property which controls the shape of the cursor when the cursor is above the component. The component's cursor property can be changed at any time by calling Component.setCursor(). See the Cursor class for available predefined cursor shapes.
// Create a component Component comp = new Button("OK"); // By default, the component's cursor is Cursor.DEFAULT_CURSOR Cursor cursor = comp.getCursor(); // Change the component's cursor to another shape comp.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.