Problems with UI


Hi there,

i got very often errors like this:
WARN - tellij.ide.HackyRepaintManager - Access to realized (ever shown) UI components should be done only from the AWT event dispatch thread, revalidate(), invalidate() & repaint() is ok from any thread

on Actions like this

Trivial Action, but no trivial Error or Warning... what does it mean?

Comment actions Permalink
Official comment

It means, as it says, that you do this setText from some thread other than AWT/Swing thread, and this might lead to a deadlock or strange artifacts on the screen because of concurrency issues. The usual solution is to use SwingUtilities.invokeLater/invokeAndWait or same-named methods in ApplicationManager.getApplication().

Comment actions Permalink

Thank you. On Stackoverflow if found this snippet what helped:


    SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            // do UI actions


Please sign in to leave a comment.