示例#1
0
  private void showMemoryWarning() {
    Logger.warning("Memory " + (MEMORY_FULL_WARNING_THRESHOLD * 100.0) + "% full.");

    ThreadHelper.runOnFxThread(
        () -> {
          Alert alert = new Alert(AlertType.WARNING);
          alert.setTitle(FxComponent.DEFAULT_RESOURCES.getString("MemoryWarningPane.title"));
          alert.setHeaderText(FxComponent.DEFAULT_RESOURCES.getString("MemoryWarningPane.header"));
          alert.setContentText(
              FxComponent.DEFAULT_RESOURCES.getString("MemoryWarningPane.message"));
          alert.show();
          Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
          stage.toFront();
          stage.setAlwaysOnTop(true);
        });
  }
 // <lg>
 private String getUnableToOpenString(String key, Object[] args) {
   MessageFormat formatter =
       new MessageFormat(
           edu.wustl.lookingglass.croquetfx.FxComponent.DEFAULT_RESOURCES.getString(key));
   return formatter.format(args);
 }