When the user clicks on a particular component on my GUI a listener dispatches the code below which, in turn, executes a method that creates a system process to update the computer clock with network time servers.
LinxSUSO.syncClockDebug() contains this code (and more of course) and the command it runs is "sudo /usr/sbin/ntpdate":
My problem that the first comment written to the log (JTextArea) is not written until LinuxSUDO.syncClockDebug(); returns and it doesn't return until the the Process p completes. In the development environment this takes about 10 seconds but the user has no feedback that the mouse click worked - and that violates one of my top principles of user interactions; always provide feedback.
How can I get the JTextArea to update immediately after the comment is wrtten to it?
Thanks, Rob and Paul, my use of runtime() is up to mediocre!
I have code that works - except - I'd like to get a string back from the process to display difference it time that was found if the sync works and the error message if it doesn't I couldn't follow all from the Oracle reference. Here's what I'm using now. (edit: a couple of typos)
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
a bit of art, as a gift, that will fit in a stocking