The component's cursor property can be changed at any time by calling Component.setCursor() in Java. See the java.awt.Cursor class for available predefined cursor shapes.

// Create a componentComponent component = new Button("OK");// By default, the component's cursor is Cursor.DEFAULT_CURSORCursor cursor = component.getCursor();// Change the component's cursor to another shapecomponent.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));