AWT events are not allowed inside write action On applyFix
Answered
When I show a dialog on localQuickFix, idea throw me a Throwable "AWT events are not allowed inside write action: java.awt.event.FocusEvent[FOCUS_LOST,temporary,opposite=EditorComponent..."
Something like I lost focus from main panel ?
Is there any method I can show a dialog when user click quickFix?
My "bug code" snippet shows as below:
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
new DialogWrapper(true) {
@Override
protected @Nullable JComponent createCenterPanel() {
return null;
}
}.show();
}
And the error stack shows as below:

Please sign in to leave a comment.
Override and return false from com.intellij.openapi.application.WriteActionAware#startInWriteAction
Wow. That's it!
Thank you Yann.