runReadAction and runWriteAction
methods of Application interface.These methods provide thread safety for the components. Read action is an action
which does no modifications to the data, write action otherwise modifies some
data.
You can call methods requiring read access from the Swing event-dispatch thread without using runReadAction
method. If you need to invoke such methods from another thread you have to use runReadAction.
Multiple read actions can run at the same time without locking each other.
Write action can be called only from the Swing thread using runWriteAction
method. If there are read actions running at this moment runWriteAction is blocked
until they are completed.