Implement a Execution Log in Java

徘徊边缘 提交于 2019-12-24 12:24:46

问题


Coming from a WPF world, I am having a hard time implementing some basic stuff in Java. I need to execute a *.JAR file from another java GUI application. This JAR file takes minutes to finish, and I want the GUI not to freeze.

So, my initial solution would be: create a SwingWorker class to call a command line in background.

My main concerns are:

  1. I need to get the console output from the *.JAR file and show it in the GUI. Is it possible to update the GUI from a background thread?

  2. Is it possible to cancel the thread from a user input?

  3. How do I get notified that the thread is finished?

  4. Is my solution a good one?

来源:https://stackoverflow.com/questions/22811087/implement-a-execution-log-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!