Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException:2at org.jcjava.dwindow.Dwindow.actionPerformed(Dwindow.java:46)at java.awt.TextField.processActionEvent(Unknown Source)at java.awt.TextField.processEvent(Unknown Source)a

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/07 11:02:40

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException:2at org.jcjava.dwindow.Dwindow.actionPerformed(Dwindow.java:46)at java.awt.TextField.processActionEvent(Unknown Source)at java.awt.TextField.processEvent(Unknown Source)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)

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException:2at org.jcjava.dwindow.Dwindow.actionPerformed(Dwindow.java:46)at java.awt.TextField.processActionEvent(Unknown Source)at java.awt.TextField.processEvent(Unknown Source)a
数组越界了,你的使用了不可用的索引:
比如:
int[] a = new int[3];
a[3] = 1;
这个就是错了,因为a[3]不存在
你看看你声明的组件的数组是不是也出现了这个情况,比如把
JTextField放在一个数组里,然后越界

这是英文吗?到计算机技术板去问问,我虽对java不熟,但光看这些代码,每人知道是什么东西,要详细点

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.Illega...

全部展开

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.IllegalArgumentException: Invalid substring range
at java.text.AttributedString$AttributedStringIterator.(Unknown Source)
at java.text.AttributedString.getIterator(Unknown Source)
at javax.swing.text.Utilities.drawComposedText(Unknown Source)
at javax.swing.text.PlainView.drawElement(Unknown Source)
at javax.swing.text.PlainView.drawLine(Unknown Source)
at com.mathworks.mde.cmdwin.CmdWinSyntaxUI$SyntaxPlainView.drawLine(CmdWinSyntaxUI.java:509)
at javax.swing.text.PlainView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paintViewDoubleBuffered(Unknown Source)
at javax.swing.JViewport.paintView(Unknown Source)
at javax.swing.JViewport.windowBlitPaint(Unknown Source)
at javax.swing.JViewport.setViewPosition(Unknown Source)
at javax.swing.JViewport.scrollRectToVisible(Unknown Source)
at javax.swing.JComponent.scrollRectToVisible(Unknown Source)
at javax.swing.text.DefaultCaret.adjustVisibility(Unknown Source)
at javax.swing.text.DefaultCaret.repaintNewCaret(Unknown Source)
at javax.swing.text.DefaultCaret$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)
java.lang.IllegalArgumentException: Invalid substring range
at java.text.AttributedString$AttributedStringIterator.(Unknown Source)
at java.text.AttributedString.getIterator(Unknown Source)
at javax.swing.text.Utilities.drawComposedText(Unknown Source)
at javax.swing.text.PlainView.drawElement(Unknown Source)
at javax.swing.text.PlainView.drawLine(Unknown Source)
at com.mathworks.mde.cmdwin.CmdWinSyntaxUI$SyntaxPlainView.drawLine(CmdWinSyntaxUI.java:509)
at javax.swing.text.PlainView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paintViewDoubleBuffered(Unknown Source)
at javax.swing.JViewport.paintView(Unknown Source)
at javax.swing.JViewport.windowBlitPaint(Unknown Source)
at javax.swing.JViewport.setViewPosition(Unknown Source)
at javax.swing.JViewport.scrollRectToVisible(Unknown Source)
at javax.swing.JComponent.scrollRectToVisible(Unknown Source)
at javax.swing.text.DefaultCaret.adjustVisibility(Unknown Source)
at javax.swing.text.DefaultCaret.repaintNewCaret(Unknown Source)
at javax.swing.text.DefaultCaret$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)
java.lang.IllegalArgumentException: Invalid substring range
at java.text.AttributedString$AttributedStringIterator.(Unknown Source)
at java.text.AttributedString.getIterator(Unknown Source)
at javax.swing.text.Utilities.drawComposedText(Unknown Source)
at javax.swing.text.PlainView.drawElement(Unknown Source)
at javax.swing.text.PlainView.drawLine(Unknown Source)
at com.mathworks.mde.cmdwin.CmdWinSyntaxUI$SyntaxPlainView.drawLine(CmdWinSyntaxUI.java:509)
at javax.swing.text.PlainView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paintViewDoubleBuffered(Unknown Source)
at javax.swing.JViewport.paintView(Unknown Source)
at javax.swing.JViewport.windowBlitPaint(Unknown Source)
at javax.swing.JViewport.setViewPosition(Unknown Source)
at javax.swing.JViewport.scrollRectToVisible(Unknown Source)
at javax.swing.JComponent.scrollRectToVisible(Unknown Source)
at javax.swing.text.DefaultCaret.adjustVisibility(Unknown Source)
at javax.swing.text.DefaultCaret.repaintNewCaret(Unknown Source)
at javax.swing.text.DefaultCaret$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)
java.lang.IllegalArgumentException: Invalid substring range
at java.text.AttributedString$AttributedStringIterator.(Unknown Source)
at java.text.AttributedString.getIterator(Unknown Source)
at javax.swing.text.Utilities.drawComposedText(Unknown Source)
at javax.swing.text.PlainView.drawElement(Unknown Source)
at javax.swing.text.PlainView.drawLine(Unknown Source)
at com.mathworks.mde.cmdwin.CmdWinSyntaxUI$SyntaxPlainView.drawLine(CmdWinSyntaxUI.java:509)
at javax.swing.text.PlainView.paint(Unknown Source)

收起