Search in sources :

Example 1 with Alert

use of javafx.scene.control.Alert in project L42 by ElvisResearchGroup.

the class FrameFX method loadEventHandler.

private static void loadEventHandler() {
    synchronized (dumbLock) {
        Platform.runLater(() -> {
            Object o = NestedPrivate.webEngine.executeScript("window.event42");
            assert o instanceof JSObject : o.toString();
            JSObject jsobj = (JSObject) o;
            FrameFX.eventCollector = new EventCollected();
            jsobj.setMember("eventCollector", eventCollector);
            NestedPrivate.webEngine.setOnAlert(event -> {
                Alert alert = new Alert(AlertType.INFORMATION);
                alert.setTitle("Information Dialog");
                alert.setHeaderText(null);
                alert.setContentText(event.getData());
                alert.showAndWait();
            });
            //<a href="" onclick="java.add('bla');">here</a>
            synchronized (dumbLock) {
                dumbLock.notifyAll();
            }
        });
        waitForCompletion();
    }
}
Also used : JSObject(netscape.javascript.JSObject) JSObject(netscape.javascript.JSObject) Alert(javafx.scene.control.Alert)

Example 2 with Alert

use of javafx.scene.control.Alert in project fxexperience2 by EricCanull.

the class SplinePanelController method copyCodeAction.

@FXML
private void copyCodeAction(MouseEvent event) {
    String code = codeTextField.getText();
    Clipboard.getSystemClipboard().setContent(Collections.singletonMap(DataFormat.PLAIN_TEXT, code));
    Alert alert = new Alert(Alert.AlertType.INFORMATION, "CSS copied to the clipboard.", ButtonType.OK);
    alert.getDialogPane().setId("Code-dialog");
    alert.setHeaderText(null);
    alert.getDialogPane().getStylesheets().add(AppPaths.STYLE_PATH + "dialog.css");
    alert.showAndWait();
}
Also used : Alert(javafx.scene.control.Alert) FXML(javafx.fxml.FXML)

Example 3 with Alert

use of javafx.scene.control.Alert in project Smartcity-Smarthouse by TechnionYP5777.

the class UserInfoController method alertMessageUnvalidInput.

private static void alertMessageUnvalidInput() {
    final Alert alert = new Alert(AlertType.ERROR);
    alert.setTitle("Error Dialog");
    alert.setHeaderText("Bad Input");
    alert.setContentText("Make sure to enter only valid names and phone numbers");
    alert.showAndWait();
}
Also used : Alert(javafx.scene.control.Alert)

Example 4 with Alert

use of javafx.scene.control.Alert in project Smartcity-Smarthouse by TechnionYP5777.

the class UserInfoController method setButtons.

private void setButtons() {
    userSaveField.setOnAction(event -> {
        final String name = userNameField.getText(), id = userIDField.getText(), phoneNum = userPhoneNumField.getText(), address = userHomeAddressField.getText();
        if (!validateUserInput(name, id, phoneNum, address))
            alertMessageUnvalidInput();
        else if (getModel().isUserInitialized()) {
            final UserInformation temp = getModel().getUser();
            temp.setHomeAddress(address);
            temp.setPhoneNumber(phoneNum);
        } else {
            getModel().initializeUser(name, id, phoneNum, address);
            userNameField.setEditable(false);
            userIDField.setEditable(false);
        }
    });
    saveButton.setOnAction(event -> {
        if (getModel().isUserInitialized())
            if (validateUserInput(addNameField.getText(), addIDField.getText(), addPhoneField.getText(), addEmailField.getText()))
                addContactToTable(event);
            else
                alertMessageUnvalidInput();
        else {
            final Alert alert = new Alert(AlertType.ERROR);
            alert.setTitle("Error Dialog");
            alert.setHeaderText("User Not Registered");
            alert.setContentText("Make sure to register the user before adding any contacts");
            alert.showAndWait();
        }
    });
}
Also used : UserInformation(il.ac.technion.cs.smarthouse.system.user_information.UserInformation) Alert(javafx.scene.control.Alert)

Example 5 with Alert

use of javafx.scene.control.Alert in project Smartcity-Smarthouse by TechnionYP5777.

the class ApplicationsInstallerViewController method alert.

private static void alert(final String messege) {
    final Alert alert = new Alert(AlertType.WARNING);
    alert.setTitle("ALERT");
    alert.setHeaderText("Installation Error");
    alert.setContentText(messege);
    alert.show();
}
Also used : Alert(javafx.scene.control.Alert)

Aggregations

Alert (javafx.scene.control.Alert)212 ButtonType (javafx.scene.control.ButtonType)70 FXML (javafx.fxml.FXML)55 Stage (javafx.stage.Stage)52 ActionEvent (javafx.event.ActionEvent)36 KeyFrame (javafx.animation.KeyFrame)32 Timeline (javafx.animation.Timeline)32 EventHandler (javafx.event.EventHandler)32 File (java.io.File)21 IOException (java.io.IOException)17 TextInputDialog (javafx.scene.control.TextInputDialog)15 Button (javafx.scene.control.Button)14 Label (javafx.scene.control.Label)14 FileChooser (javafx.stage.FileChooser)13 GridPane (javafx.scene.layout.GridPane)12 GoToOperation (operation.GoToOperation)11 TextArea (javafx.scene.control.TextArea)10 ArrayList (java.util.ArrayList)9 Scene (javafx.scene.Scene)9 AlertType (javafx.scene.control.Alert.AlertType)9