首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

java的gui(2)

2012-12-28 
java的gui(二)既然这EventDispatchThread是一个线程,那肯定是从run方法开始了run中的finally块中有块有意

java的gui(二)
既然这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打印出来了,但貌似没任何影响,这是为什么呢?
就是这一小段代码的功劳了。
线程死了,但它又让线程恢复过来了

热点排行