为什么:
现在你可以直接在Java或在FXML使用: public class ExceptionPane extends BorderPane { private final ObjectProperty exception ; public ObjectProperty exceptionProperty() { return exception ; } public final Exception getException() { return exceptionProperty().get(); } public final void setException(Exception exception) { exceptionProperty().set(exception); } @FXML private final TextArea stackTrace ; @FXML private final Label message ; public ExceptionPane() throws Exception { FXMLLoader loader = new FXMLLoader(getClass().getResource("path/to/fxml")); loader.setRoot(this); loader.setController(this); loader.load(); exception.addListener((obs, oldException, newException) -> { if (newException == null) { message.setText(null); stackTrace.setText(null); } else { message.setText(newException.getMessage()); StringWriter sw = new StringWriter(); newException.printStackTrace(new PrintWriter