当前位置: 代码迷 >> J2SE >> "AWT-EventQueue-0" java.lang.IllegalThreadStateException
  详细解决方案

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

热度:865   发布时间:2016-04-24 18:13:57.0
线程问题,运行时候泡这个异常!
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 方法可以强行干掉线程,但不推荐。
  相关解决方案