Determine if Invoke is Required

How can I determine if an invoke is required? I have a method that needs to display a dialog. The problem is that this method could be called from anywhere in the application from any thread. So I want to put a check in the method to see if I should use Invoke to display the dialog or if I can just display it directly.

[327 byte] By [BaltimoreJohna] at [2007-10-2 23:46:03]
# 1
Don't know what you mean by "invoke" versus display directly?Maybe this is what you are looking for:SwingUtilities.isEventDispatchThread()
camickra at 2007-7-14 16:30:32 > top of Java-index,Desktop,Core GUI APIs...
# 2
That looks like exactly what I need. Thanks.
BaltimoreJohna at 2007-7-14 16:30:32 > top of Java-index,Desktop,Core GUI APIs...