Example usage for java.awt Window setCursor

List of usage examples for java.awt Window setCursor

Introduction

In this page you can find the example usage for java.awt Window setCursor.

Prototype

public void setCursor(Cursor cursor) 

Source Link

Document

Set the cursor image to a specified cursor.

Usage

From source file:no.imr.sea2data.stox.InstallerUtil.java

public static boolean installRstox(Window wnd, String ftpPath, String rFolder) {
    //        String pkgFile = getIOTempDirFile(RSTOX + TARGZ);
    //        retrieveRstox(ftpPath, pkgFile);
    wnd.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    try {//from ww w  .  j a v a  2 s.com
        return RUtils.installRstox(ftpPath, rFolder);
    } finally {
        wnd.setCursor(Cursor.getDefaultCursor());
    }
}

From source file:tvbrowser.ui.mainframe.MainFrame.java

/**
 * Show Settings Dialog for a specific TabId
 *
 * @param visibleTabId/*from   w ww .j  a  v  a2 s  .  c o  m*/
 *          Id of the specific Tab
 */
public void showSettingsDialog(final String visibleTabId) {
    if (mSettingsWillBeOpened) {
        return;
    }

    new Thread(new Runnable() {
        public void run() {
            mSettingsWillBeOpened = true;

            // show busy cursor
            Window comp = UiUtilities.getLastModalChildOf(MainFrame.getInstance());
            ProgramTable programTable = MainFrame.getInstance().getProgramTableScrollPane().getProgramTable();
            Cursor oldWindowCursor = comp.getCursor();
            Cursor oldTableCursor = programTable.getCursor();
            comp.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            programTable.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

            SettingsDialog dlg = new SettingsDialog(MainFrame.this, visibleTabId);
            dlg.centerAndShow();

            // restore cursors
            programTable.setCursor(oldTableCursor);
            comp.setCursor(oldWindowCursor);

            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    Settings.handleChangedSettings();
                    if (mPluginView != null) {
                        mPluginView.refreshTree();
                    }
                }
            });
            mSettingsWillBeOpened = false;
        }
    }, "Show settings dialog").start();
}