calling invokeAndWait from the EDT

后端 未结 4 2007
忘了有多久
忘了有多久 2020-12-16 22:34

I have a problem following from my previous problem. I also have the code SwingUtillities.invokeAndWait somewhere else in the code base, but when I remove this

4条回答
  •  渐次进展
    2020-12-16 23:27

    invokeAndWait() is meant to be called from the non-GUI thread. It sends a Runnable object to the GUI thread where it will be executed.

    There's no point in sending a Runnable object from the GUI-thread to itself. It has the same effect as calling run() on the Runnable object directly.

提交回复
热议问题