Skip to main content

ArrayIndexOutOfBoundsException in JTabbedPane

2 replies [Last post]
jmin
Offline
Joined: 2006-01-27

'm building a sort of a editor that has the windows explorer (as JTree )in one side of splitpane and open the file he clicks on the explorer in the other side of the splitpane as JTabbedPane.Everytime a file is opened a tab is inserted in the JTabbedPane.
but i get exception every other time i open a file,the exception is

Exception occurred during event dispatching:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at java.awt.Container.addImpl(Container.java:385)
at javax.swing.JLayeredPane.addImpl(JLayeredPane.java:211)
at java.awt.Container.add(Container.java:294)

what might be the reason for this exception.
Or is there any other way to view all the files that are opened in the editor.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Andrei V. Dmitriev

Hi jmin,

Just to know more: what version of JDK do you use? There are a pair of
lines in Component uses arraycopy.
Thanks,
-Andrei

swing-feedback@javadesktop.org wrote:
> 'm building a sort of a editor that has the windows explorer (as JTree )in one side of splitpane and open the file he clicks on the explorer in the other side of the splitpane as JTabbedPane.Everytime a file is opened a tab is inserted in the JTabbedPane.
> but i get exception every other time i open a file,the exception is
>
> Exception occurred during event dispatching:
> java.lang.ArrayIndexOutOfBoundsException
> at java.lang.System.arraycopy(Native Method)
> at java.awt.Container.addImpl(Container.java:385)
> at javax.swing.JLayeredPane.addImpl(JLayeredPane.java:211)
> at java.awt.Container.add(Container.java:294)
>
>
> what might be the reason for this exception.
> Or is there any other way to view all the files that are opened in the editor.
> ---
> [Message sent by forum member 'jmin' (nirmalpj)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=38388&#38388

Scott Violet

What thread are you invoking this on?

-Scott