How To: Solve “Cannot add Library” Problem (ArrayIndexOutOfBounds) in Netbeans on Vista
Written by Matrich on 21st October, 2008
Netbeans IDE is one of the famous IDEs used by Java and other programmers and it is especially very good when you are creating graphical user interfaces (GUI) applications.
Lately, I have been working on a java project and I have been facing a problem with using Netbeans on my Microsoft Windows Vista to add external libraries to the project. Normally external libraries are packaged as .jar files.

Whenever I try to click the Add JAR/Folder button as on the screenshot above, instead of getting the Open File dialog, I was getting a java.lang.ArrayIndexOutOfBoundsException as shown below:
java.lang.ArrayIndexOutOfBoundsException: 3184
at sun.awt.shell.Win32ShellFolder2.getFileChooserIcon(Win32ShellFolder2.java:748)
at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:248)
at sun.awt.shell.ShellFolder.get(ShellFolder.java:221)
at com.sun.java.swing.plaf.windows.WindowsLookAndFeel$LazyWindowsIcon.createValue(WindowsLookAndFeel.java:1873)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:185)
at javax.swing.UIDefaults.get(UIDefaults.java:130)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
……
…
Source of the Problem
This is exception is mainly caused because of some incompatibilities issues of the JDK you are using and Microsoft Vista. To be more specific, the java file chooser dialog using WindowsLookAndFeel is incompatible with Ms. Windows Vista on any Java release less than 1.5.0_11 caused by some changes made by Microsoft in Ms. Windows Vista.
Solution to the Problem
To solve this problem,
- Update your JDK to JDK 6 and above
- Ensure that your Netbeans IDE uses the new updated JDK instead of the previous JDK which has been upgraded.
A few days ago, I wrote about
Overall, the workshop was a great success as over 100 headteachers attended the workshop and a lot of great sessions where held at the workshop.
In just two days, a group of around 300 students with a computing and luganda linguistics background were able to translate about 8,000 words of the Mozilla’s user interface into luganda.
I know you might be wondering how I have reached this age and yet I claim that I was just baptized yesterday. In fact, when I called a good friend of mine yesterday to tell him about it, he was kinda shocked. Yeah! it is true and that’s why it had also taken me a long time even when I gave my life to Christ in 2001.
Recently as I transversed the internet, I came across two great events which will be taking place here in Kampala, Uganda. This is really good news for the developers hanging up in Uganda where you can meet and share experiences. I haven’t seen mob of such events coming up in Uganda and thank God finally we’ve got some coming over here.
Another great interesting event up for grabs is
You are currently browsing Matrich, an online portfolio, weblog and playground of Matovu Richard