protected boolean requestFocusInWindowForComponent(final JComponent c, int maxWaitTime)
throws Exception {
FocusListener listener = addFocusListener(c);
RunnableResulted thread = new RunnableResulted() {
@Override
public void run() {
result = c.requestFocusInWindow();
}
};
SwingUtilities.invokeAndWait(thread);
if (!thread.result) {
return false;
}
synchronized (listener) {
listener.wait(maxWaitTime);
}
waitForIdle();
if (!c.isFocusOwner()) {
fail();
}
return true;
}
JComponent_MultithreadedTest.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:cn1
作者:
评论列表
文章目录