JavaFX - 为什么system.out.println在我的应用程序中不起作用



我想在我的应用程序调试中获取控制台输出,但是无论我在哪里放置println方法控制台都不会打印任何内容。例如,我想在点击"播放"按钮后得到"Hi",除了println之外的所有内容都会正常调用。

@FXML
protected void handlePlayButton(ActionEvent event) {
    System.out.println("hi!");
    filePath = cTable.getSelectionModel().getSelectedItem().getFilePath();
    index = cTable.getSelectionModel().getSelectedIndex();
    player = new Play();
    player.player(filePath);

}

标准输出指向的位置可能存在问题。您是在 IDE 中运行它,还是可能已将其重定向到代码中的其他位置?

相关内容

最新更新