Generate a new error Alert object @param content The content that should be displayed to the user @return The Alert object that was generated
(final String content)
| 89 | * @return The {@link Alert} object that was generated |
| 90 | */ |
| 91 | private static Alert getErrorAlert(final String content) { |
| 92 | final Alert alert = new Alert(Alert.AlertType.ERROR); |
| 93 | |
| 94 | final GridPane expContent = new GridPane(); |
| 95 | expContent.setMaxWidth(Double.MAX_VALUE); |
| 96 | |
| 97 | final TextArea textArea = new TextArea(content); |
| 98 | textArea.setEditable(false); |
| 99 | textArea.setWrapText(true); |
| 100 | |
| 101 | textArea.setMaxWidth(Double.MAX_VALUE); |
| 102 | textArea.setMaxHeight(Double.MAX_VALUE); |
| 103 | GridPane.setVgrow(textArea, Priority.ALWAYS); |
| 104 | GridPane.setHgrow(textArea, Priority.ALWAYS); |
| 105 | |
| 106 | expContent.add(textArea, 0, 0); |
| 107 | alert.getDialogPane().setExpandableContent(expContent); |
| 108 | |
| 109 | return alert; |
| 110 | } |
| 111 | } |