2 xiaoduc xiaoduc 于 2014.12.15 16:46 提问

java中的异常怎么解决啊

Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException
at java.util.StringTokenizer.nextToken(Unknown Source)
at Student.parseStudent(Student.java:13)
at Selector.loadStudents(Selector.java:46)
at Mainwin$1.windowOpened(Mainwin.java:53)
at java.awt.Window.processWindowEvent(Unknown Source)
at javax.swing.JFrame.processWindowEvent(Unknown Source)
at java.awt.Window.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)

4个回答

devmiao
devmiao   Ds   Rxr 2014.12.15 16:50
zhj5979
zhj5979 你怎么什么都知道 看看我的问题呗
大约 3 年之前 回复
zxuwen
zxuwen   2014.12.15 21:27

在你Student类的13行,是不是有什么无法识别的元素哦? java.util.NoSuchElementException。or访问越界??

u012446233
u012446233   2014.12.16 16:22

java.util.NoSuchElementException,说的意思就是没有这样的数据元素,在代码13行仔细查看

shuytu
shuytu   2014.12.19 11:15

建议把
at Student.parseStudent(Student.java:13)
at Selector.loadStudents(Selector.java:46)
两个类中都好好查看一下,13行,46行

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!