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();
}
}
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();
}
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();
}
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();
}
});
}
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();
}
Aggregations