示例#1
0
  public static void showError(String message, Throwable t) {
    LOG.log(Level.SEVERE, "Сообщение: " + message, t);

    StringBuilder s = new StringBuilder(message).append('\n');
    s.append(t.getClass().getName()).append(": ").append(t.getLocalizedMessage());
    for (StackTraceElement e : t.getStackTrace()) {
      String line = e.toString();
      if (line.startsWith("my")) {
        s.append("\n    ").append(line);
      }
    }
    Alert alert = new Alert(Alert.AlertType.ERROR, s.toString(), ButtonType.OK);
    alert.showAndWait();
  }
示例#2
0
  public static void showMessage(String message) {
    LOG.log(Level.SEVERE, "Сообщение: {0}", message);

    Alert alert = new Alert(Alert.AlertType.INFORMATION, message, ButtonType.OK);
    alert.showAndWait();
  }