1

I've made a little GUI for youtube-dl, but for this project, I nedd kind of a "live" output from a system command. I already tried this, but this only displays the output when the process has finished. I need something which displays the progress of my download continously (youtube-dl is just a command line tool, so it needs to refresh about every second).

How do i do that?

Lorenz
  • 39
  • 6

2 Answers2

1

I would suggest starting a new Thread by hitting the Download-Button by using:

Runner = new Thread(this, "ExternalProcessTest");
Runner.start();

in the Listener.

Additional Infos about GUI-Threads could be found here: non-blocking Thread

Some additional approaches for progress bars in a console: progress-bar console

Community
  • 1
  • 1
JonasP
  • 51
  • 1
  • 6
0

After a bit of searching, I found the answer:

My Problem was, that the Terminal, where "System.out.println()" prints its output to, didn't refresh. It just wrote the outout after the Process finished, but because I'm writing a Download client, you have to see the progress of your Download. So I've done it this way:

Get output of terminal command using Java

Community
  • 1
  • 1
Lorenz
  • 39
  • 6