Example usage for javafx.scene Cursor WAIT

List of usage examples for javafx.scene Cursor WAIT

Introduction

In this page you can find the example usage for javafx.scene Cursor WAIT.

Prototype

Cursor WAIT

To view the source code for javafx.scene Cursor WAIT.

Click Source Link

Document

The wait cursor type.

Usage

From source file:de.bayern.gdi.gui.Controller.java

/**
 * Handle the service selection./* w w w  .jav  a  2s .  c  o m*/
 *
 * @param event The mouse click event.
 */
@FXML
protected void handleServiceSelect(MouseEvent event) {
    if (event.getEventType().equals(MouseEvent.MOUSE_CLICKED)) {
        if (event.getClickCount() == 1) {
            clearUserNamePassword();
            ServiceModel serviceModel = (ServiceModel) this.serviceList.getSelectionModel().getSelectedItems()
                    .get(0);
            if (serviceModel != null) {
                serviceSelection.setDisable(true);
                serviceURL.getScene().setCursor(Cursor.WAIT);
                setStatusTextUI(I18n.format("status.checking-auth"));
                Task task = new Task() {
                    protected Integer call() {
                        try {
                            selectService(serviceModel.getItem());
                            return 0;
                        } finally {
                            serviceSelection.setDisable(false);
                            serviceURL.getScene().setCursor(Cursor.DEFAULT);
                        }
                    }
                };
                Thread th = new Thread(task);
                th.setDaemon(true);
                th.start();
            }
        } else if (event.getClickCount() > 1) {
            clearUserNamePassword();
            resetGui();
        }
    }
}