How to tell if a process is running?

Hi,

We have a button that if pressed some tags are browsed, read and then displayed in a table component.
This process takes a few moments and while it runs I’d like to display fx. in a label that the the process is running / working.
When the process is done I’d like to display done / ready.

How would I go about doing this?

Thanks

Write your label text to “processing” or whatever you want, then call the rest of your stuff inside a function that’s called by system.util.invokeLater. Your gui will be locked up until the script finishes, unless you ask part of it to run after its finished executing (by using invokeLater)

No, not invokeLater. That runs a function on the gui thread, too. See this topic:

If you just want to display “running” and then “finished” text though, invokeLater is fine, as you can set the text to “running” before calling invokeLater, and “finished” at the the of the function called by invokeLater. Obviously if you want to keep updating the text with a percentage, then you’ll need an async thread

Thanks