Java Utililty Methods Swing Cursor

List of utility methods to do Swing Cursor

Description

The list of methods to do Swing Cursor are organized into topic(s).

Method

voidshowDefaultCursorOnWindow(Component caller)
show Default Cursor On Window
showDefaultCursor(caller, true);
voidstartWaitCursor(JComponent component)
start Wait Cursor
RootPaneContainer root = ((RootPaneContainer) component.getTopLevelAncestor());
root.getGlassPane().setCursor(WAIT_CURSOR);
root.getGlassPane().addMouseListener(CLICK_CONSUMER);
root.getGlassPane().setVisible(true);
root.getRootPane().validate();
voidstartWaitCursor(JComponent component)
Sets the wait (hourglass) mouse cursor for an application containing component.
RootPaneContainer root = (RootPaneContainer) component.getTopLevelAncestor();
root.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
root.getGlassPane().addMouseListener(noopMouseAdapter);
root.getGlassPane().setVisible(true);
voidwaitCursorOff(Component comp)
Turns the waits cursor off.
if (glassPaneCursor != null) {
    Component gp = getGlassPane(comp);
    gp.setVisible(glassPaneVisible);
    gp.setCursor(glassPaneCursor);
    glassPaneVisible = false;
    glassPaneCursor = null;