In general you don't need to ever use getTreeLock() in Swing. Using invokeLater is enough to ensure thread-safety until unless your own code does something really funny. Having said that I still find people writing layoutContainer() method(when creating their own layout managers) synchronized over the object returned by getTreeLock(). I am not sure whether it's absolutely necessary in all cases. You must know why treelocks are used at the first hand. Whenever componenets are validated or updated or blah blah blah... the Component's code will obtain the lock over that component. Now what if some other
thread tries to do the same? So it's necessary that tree lock is used during such activities. But we dont need to care about it much, until unless you are dwelliung really deep in to AWT internals.
Cheers, Suraj