File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JTabbedPane problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTabbedPane problem" Watch "JTabbedPane problem" New topic

JTabbedPane problem

Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192
I want to add 3 tabs into a JTabbedPane, but when I try to add the 3rd one, I get the following exception, if I add 2 tabs I DON'T get any exception.
The code is:

The exception is

java.lang.ArrayIndexOutOfBoundsException: 2 > 1
at java.util.Vector.insertElementAt(
at javax.swing.JTabbedPane.insertTab(
at javax.swing.JTabbedPane.addTab(

The exception occures at the last line of code.
Thank you
[ January 30, 2003: Message edited by: Garandi Garandi ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Could you please post more code than that? Specifically where you initialized your entire JTabbedPane, and not just where you are adding tabs. The all the code for that Class would probably be best.

GenRocket - Experts at Building Test Data
Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192
Thank you Gregg.
This is the code for the application.
I agree. Here's the link:
subject: JTabbedPane problem
It's not a secret anymore!