java的gui(二)

Posted on 2011-03-04 19:43 snake 阅读(61) 评论(0)  编辑  收藏
既然这EventDispatchThread是一个线程,那肯定是从run方法开始了

run中的finally块中有块有意思的代码
/*
                 * Fix for 4648733. Check both the associated java event
                 * queue and the PostEventQueue.
                 */
                if (theQueue.peekEvent() != null || 
                    !SunToolkit.isPostEventQueueEmpty()) { 
                    theQueue.initDispatchThread();
                }

像我们调试中经常发现有unchecked exception没有捕获,在console打印出来了,但貌似没任何影响,这是为什么呢?
就是这一小段代码的功劳了。
线程死了,但它又让线程恢复过来了


已有 0 人发表留言,猛击->>这里<<-参与讨论


ItEye推荐




只有注册用户登录后才能发表评论。


网站导航: