日期:2014-05-20  浏览次数:20874 次

大家来看看
Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsExceptio
: String index out of range: 19968
  at java.lang.String.checkBounds(String.java:409)
  at java.lang.String.<init>(String.java:577)
  at denglu$1.actionPerformed(denglu.java:92)
  at java.awt.Button.processActionEvent(Button.java:409)
  at java.awt.Button.processEvent(Button.java:377)
  at java.awt.Component.dispatchEventImpl(Component.java:4578)
  at java.awt.Component.dispatchEvent(Component.java:4404)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:605)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThr
ad.java:286)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread
java:201)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
ad.java:191)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186

  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178

什么情况啊
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:139)

------解决方案--------------------
象是字符串索引越界,查查这:
at denglu$1.actionPerformed(denglu.java:92) 
denglu.java 92行。
------解决方案--------------------
是不是用了string.indexOf?好像是索引超出范围了。
------解决方案--------------------
像楼上所说的,你可能是犯了一个string.indexOf的操作错误,你不能超过字符串的总长度