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?

0

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! Willt ry thaat. But my solution works for me, too! :D
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.