Is it possible to not block UI when UI depends on background tasks?

Hi, I registered an action which would call an external command and popup a dialog based on command output. What I wanna do is executing external command in background, so that users could do any other thing with IDE instead of waiting the dialog.

Seems that I should use executeOnPooledThread to call command, and after that, call Application.invokeLater to create dialog in UI thread. But I found that UI was still blocked until the dialog popped up. 

is there any possible way not to block UI? Thanks in advance.

0

If the UI is blocked, this means that Swing thread isn't processing events properly. You can check what it does instead by taking a thread dump.

1
Avatar
Permanently deleted user

Thanks, and sorry for the late reply.

I took a thread dump and found that UI thread (AWT EventQueue) was still blocked by another external tasks. Turns out that it's just a bug in my plugin.

And I've fixed it by separating UI tasks and external tasks thoroughly.

0

请先登录再写评论。