0

Firstly I should say that the Java application, once created, will be run on a raspberry pi so will have access to Unix X terminal in order to run shell scripts.

I have a swing JDialog with a text box and a button. The button currently opens the results JDialog, I just now have to try and figure out the workings to get a result.

The user will input a hostname into the text box, then click the button.

On click of the button I need to execute a bash shell in unix; I have the path I'll just need to append this path with "/multiping single hostname". I should say that multiping runs a script with cases whereby single pings a single host.

I then need to read the results of an output file and pass them to the results JDialog.

I am a novice with Java unfortunately and am using netbeans which isnt the most fun I've ever had, but any pointers or help or anything would be really well received.

1 Answer 1

1

You can access your dialog's content, as shown here. You can invoke ping using ProcessBuilder, as shown here. To avoid blocking the event dispatch thread, use a SwingWorker to publish() interim results from the background thread and update your GUI in process().

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

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.