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

"AWT-EventQueue-0" java.lang.IllegalThreadStateException

2011-11-09 
线程问题,运行时候泡这个异常!Exception in thread AWT-EventQueue-0 java.lang.IllegalThreadStateExce

线程问题,运行时候泡这个异常!
Exception in thread "AWT-EventQueue-0" java.lang.IllegalThreadStateException
at java.lang.Thread.start(Unknown Source)
at PlayUI.LyricsDisplay(PlayUI.java:509)
at PlayUI.playSong(PlayUI.java:868)
at PlayUI.playState(PlayUI.java:836)
at PlayUI$2.mouseClicked(PlayUI.java:287)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.List.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


[解决办法]
给你个建议吧
1 你的线程有结束条件吗?设置停止标志。
2 2个线程有冲突,你应该等第一个线程结束,再启动第二个线程
3 java的 Thread.stop 方法可以强行干掉线程,但不推荐。

热点排行