From: SourceForge.net <no...@so...> - 2006-12-13 22:27:57
|
Bugs item #1615317, was opened at 2006-12-14 09:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=689449&aid=1615317&group_id=121150 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: XNap Commons Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Greg Kopff (gkopff) Assigned to: Nobody/Anonymous (nobody) Summary: ClosableTabbedPane fails when closed using Java 6 Initial Comment: When using Java 6, the ClosableTabbedPane fails with a ArrayIndexOutOfBoundsException when you try to close it using its [X] button. Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1 >= 1 at java.util.Vector.elementAt(Unknown Source) at javax.swing.JTabbedPane.getIconAt(Unknown Source) at org.xnap.commons.gui.CloseableTabbedPane.setButtonVisible(CloseableTabbedPane.java:492) at org.xnap.commons.gui.CloseableTabbedPane.access$500(CloseableTabbedPane.java:62) at org.xnap.commons.gui.CloseableTabbedPane$SelectionHandler.stateChanged(CloseableTabbedPan e.java:504) at javax.swing.DefaultSingleSelectionModel.fireStateChanged(Unknown Source) at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(Unknown Source) at javax.swing.JTabbedPane.setSelectedIndexImpl(Unknown Source) at javax.swing.JTabbedPane.removeTabAt(Unknown Source) at org.xnap.commons.gui.CloseableTabbedPane.removeTabAt(CloseableTabbedPane.java:517) at javax.swing.JTabbedPane.remove(Unknown Source) Well, I commented out the call to setButtonVisible() which hides the old index button (see below) ... private class SelectionHandler implements ChangeListener { int oldIndex = -1; public void stateChanged(ChangeEvent e) { // GSK: commented out these three lines for JDK6 // if (oldIndex != -1) { // setButtonVisible(oldIndex, false); // } oldIndex = getSelectedIndex(); if (oldIndex != -1) { setButtonVisible(oldIndex, true); } } } This fixes the array index out of bounds exception and doesn't appear to adversely affect the operation of the tabs. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=689449&aid=1615317&group_id=121150 |