SET THE CURSOR FOR YOUR COMPONENTS The hallmark of a well-executed GUI application is in the appropriate use of various cursor types when selecting text, drawing, or waiting for a task to complete. Even though Swing components can set their own cursors, custom components or show a busy state, most developers need more control. However, this is not a problem because Swing makes it simple to set different cursors as needed. All AWT component classes have a setCursor() method that allows for dynamically setting the cursor for a particular component and any subcomponents. For example, if you set the cursor for a Panel, all the components added to that Panel would inherit the Panel's cursor unless the components explicitly override it. Once a cursor is set for a component, the cursor will be automatically used when the pointer enters the component as long as the component is visible and enabled. To set the cursor for a component, get an instance of java.awt.Cursor. This class contains many predefined cursors that are accessed using type constants such as WAIT_CURSOR or HAND_CURSOR. You can retrieve Cursor objects by using one of the constructors or the static method Cursor.getPredefinedCursor(). Here's an example to display a busy cursor (such as a watch icon) while an operation completes: myComponent.setCursor(Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR)); //do stuff myComponent.setCursor(null); //use default cursor inherited from parent Component Note that these methods need to be called from within the Swing event thread. If you call them from another thread, use the SwingUtilities.invokeLater() method to do so. You can also call getCursor() on the component if you need to save and restore the previous cursor afterwards. Setting the cursor to null may not be appropriate for components that already have a custom cursor defined. -------------------------------------------