Component.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:cn1 作者:
/**
 * Set native caret at the given position <br>
 * Note: this method takes AWT lock inside because it walks through the
 * component hierarchy
 */
void setCaretPos(final int x, final int y) {
    Runnable r = new Runnable() {
        public void run() {
            toolkit.lockAWT();
            try {
                setCaretPosImpl(x, y);
            } finally {
                toolkit.unlockAWT();
            }
        }
    };
    if (Thread.currentThread() instanceof EventDispatchThread) {
        r.run();
    } else {
        toolkit.getSystemEventQueueImpl().postEvent(new InvocationEvent(this, r));
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号