早教吧作业答案频道 -->其他-->
Exceptioninthread"AWT-EventQueue-0"java.lang.ArrayIndexOutOfBoundsException:2atorg.jcjava.dwindow.Dwindow.actionPerformed(Dwindow.java:46)atjava.awt.TextField.processActionEvent(UnknownSource)atjava.awt.TextField.processEvent(UnknownSource)a
题目详情
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException:2
at org.jcjava.dwindow.Dwindow.actionPerformed(Dwindow.java:46)
at java.awt.TextField.processActionEvent(Unknown Source)
at java.awt.TextField.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.pumpOneEventForHierarchy(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)
at org.jcjava.dwindow.Dwindow.actionPerformed(Dwindow.java:46)
at java.awt.TextField.processActionEvent(Unknown Source)
at java.awt.TextField.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.pumpOneEventForHierarchy(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)
▼优质解答
答案和解析
数组越界了,你的使用了不可用的索引:
比如:
int[] a = new int[3];
a[3] = 1;
这个就是错了,因为a[3]不存在
你看看你声明的组件的数组是不是也出现了这个情况,比如把
JTextField放在一个数组里,然后越界
比如:
int[] a = new int[3];
a[3] = 1;
这个就是错了,因为a[3]不存在
你看看你声明的组件的数组是不是也出现了这个情况,比如把
JTextField放在一个数组里,然后越界
看了 Exceptioninthr...的网友还看了以下:
java.lang.ClassCastException:info.ShopBeanatjava. 2020-04-25 …
java画图报错!看不懂是什么意思啊、、、、Exceptioninthread"AWT-Event 2020-05-13 …
Exceptioninthread"AWT-EventQueue-0"java.lang.Arra 2020-05-17 …
java 画矩形package testFrame;import java.awt.Color;i 2020-06-27 …
4、在Java中,所有类的公共基类是()A)java.lang.ObjectB)java.lang 2020-07-17 …
100分解决javaimportjava.awt.Point;importjava.awt.Rec 2020-07-17 …
求教java选择题有以下程序片段,下列哪个选项不能插入到行1。()1.2.publicclassI 2020-07-17 …
如果要使用java.awt.Button这个类,下面哪个用法是正确的?A.importjava.a 2020-07-17 …
朋友们帮下忙说出这段代码每一行的意思把每一行的意思写出来的OK了importjava.awt.*; 2020-07-27 …
xceptioninthread"Thread-3"java.lang.ArrayIndexOutO 2020-11-01 …