Example usage for java.awt Frame setCursor

List of usage examples for java.awt Frame setCursor

Introduction

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

Prototype

@Deprecated
public void setCursor(int cursorType) 

Source Link

Document

Sets the cursor for this frame to the specified type.

Usage

From source file:com.projity.pm.graphic.frames.GraphicManager.java

public void showWaitCursor(boolean show) {
    Frame frame = getFrame();
    if (frame == null)
        return;/*from w ww.j  av a  2s  . c  o  m*/
    if (show)
        frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    else
        frame.setCursor(Cursor.getDefaultCursor());
}

From source file:us.paulevans.basicxslt.Utils.java

/**
 * Displays a message dialog//  ww  w  . ja v  a2  s  . c  o  m
 * @param aParent
 * @param aMsg
 * @param aTitle
 * @param aType
 */
public static void showDialog(Frame aParent, String aMsg, String aTitle, int aType) {
    aParent.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    JOptionPane.showMessageDialog(aParent, aMsg, aTitle, aType);
}

From source file:us.paulevans.basicxslt.Utils.java

/**
 * Displays an error dialog/*from ww  w  .  j  a  v  a2s .  com*/
 * @param aParent
 * @param aThrowable
 */
public static void showErrorDialog(Frame aParent, Throwable aThrowable) {

    String message;
    Throwable throwableToReport;

    throwableToReport = ExceptionUtils.getRootCause(aThrowable);
    if (throwableToReport == null) {
        throwableToReport = aThrowable;
    }
    message = throwableToReport.getMessage();
    if (StringUtils.isBlank(message)) {
        message = ExceptionUtils.getStackTrace(throwableToReport);
    }
    if (aParent != null) {
        aParent.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
    JOptionPane.showMessageDialog(aParent,
            MessageFormat.format(stringFactory.getString(LabelStringFactory.ERRORS_MESSAGE), message,
                    AppConstants.BUG_HOME_URL),
            stringFactory.getString(LabelStringFactory.ERRORS_TITLE), JOptionPane.ERROR_MESSAGE);
}