Example usage for javax.swing JRootPane validate

List of usage examples for javax.swing JRootPane validate

Introduction

In this page you can find the example usage for javax.swing JRootPane validate.

Prototype

public void validate() 

Source Link

Document

Validates this container and all of its subcomponents.

Usage

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Sets the mouse pointer. If the supplied parameter is true then the wait
 * cursor (usually an hourglass) is displayed. otherwise the system default
 * cursor is displayed.//  w w  w  .ja v a 2 s .c  om
 * 
 * @param wait
 *          Whether to display the system default wait cursor
 */
private void setWaitCursor(boolean wait) {
    final JRootPane rootPane = getRootPane();
    final Component glassPane = rootPane.getGlassPane();

    if (wait) {
        final Cursor cursorWait = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
        rootPane.setCursor(cursorWait);
        glassPane.setCursor(cursorWait);
        glassPane.setVisible(true);
    } else {
        final Cursor cursorDefault = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
        glassPane.setVisible(false);
        glassPane.setCursor(cursorDefault);
        rootPane.setCursor(cursorDefault);
    }

    glassPane.invalidate();
    rootPane.validate();
}