List of utility methods to do Swing Cursor
Cursor | createCursor(URL url, Point hotSpot, String name) create Cursor return createCursor(new ImageIcon(url), hotSpot, name); |
void | setCursor(JComponent comp, Cursor cur) Sets the mouse cursor for a component comp.setCursor(cur); Component parent = comp.getParent(); while (parent != null) { parent = parent.getParent(); if (parent != null) parent.setCursor(cur); |
void | setCursorBusy(JComponent component) Set cursor to busy and disable application input. JDialog dialog = findContainingDialog(component); if (dialog != null) { setCursorBusy(dialog); } else { JFrame frame = findContainingFrame(component); if (frame != null) { setCursorBusy(frame); |
void | setCursorDefault(Container cont) Sets the cursor to default. if (cont == null) { System.err.println( "setCursorDefault(Container cont): Container argument cannot be null. Will return and do nothing."); return; Component glasspane = null; if (cont instanceof RootPaneContainer) { glasspane = ((RootPaneContainer) cont).getGlassPane(); ... |
void | setWaitCursor(final Component c, final boolean wait) Toggles the cursor for the given component and all child components between the wait cursor and the normal one. setCursor(c, wait ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null); |
void | setWaitCursor(JComponent comp) Sets the wait mouse cursor for this component setCursor(comp, new Cursor(Cursor.WAIT_CURSOR));
|
void | showCursor(final Cursor cursor, final Component caller, final boolean includeParent, boolean immediate) show Cursor if (caller == null) return; Runnable r = () -> { caller.setCursor(cursor); if (includeParent) { final Window w = getWindowAncestor(caller); if (w != null) { w.setCursor(cursor); ... |
void | showCursor(final Cursor cursor, final Component caller, final boolean includeParent, boolean immediate) show Cursor if (caller == null) return; Runnable r = new Runnable() { @Override public void run() { caller.setCursor(cursor); if (includeParent) { final Window w = getWindowAncestor(caller); ... |
void | showDefaultCursor() Sets cursor for specified component to normal cursor _root.getGlassPane().setCursor(Cursor.getDefaultCursor()); _root.getGlassPane().removeMouseListener(_mouseAdapter); _root.getGlassPane().setVisible(false); |
void | showDefaultCursorOnWindow(Component caller) show Default Cursor On Window showDefaultCursor(caller, true); |