diff --git a/src/main/java/caidanci/HelloController.java b/src/main/java/caidanci/HelloController.java index 4c6c6f9..340790a 100644 --- a/src/main/java/caidanci/HelloController.java +++ b/src/main/java/caidanci/HelloController.java @@ -204,7 +204,7 @@ private boolean checkWord(String word) { void initialize() { Font a = Font.loadFont(Objects.requireNonNull(this.getClass().getResourceAsStream("fonts/fzjt.ttf")), 0); -showAlert(Alert.AlertType.WARNING, "错误!", "!", "font.getFamily:" + a.getFamily()+"!"); +Platform.runLater(() -> showAlert(Alert.AlertType.WARNING, "错误!", "!", "font.getFamily:" + a.getFamily()+"!")); Platform.runLater(() -> tm.setFontFamily(a.getFamily())); Platform.runLater(() -> tm.addScene(info.getScene()));