-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: aaR10142 Date: 06/26/2000
DefaultTableModel.addColumn(name, column) does not accept too long column,
in jdk1.4, it looks like a bug because it accept short column. See example.
All works correctly in jdk1.3
------------------------- example ----------------
import javax.swing.table.DefaultTableModel;
public class Test {
public static void main(String argv[]) {
DefaultTableModel c = new DefaultTableModel(2,2);
// add short column
c.addColumn("Test", new Object[1]);
System.out.println("The short column is accepted");
// add long column
c.addColumn("Test", new Object[3]);
System.out.println("The long column is accepted");
}
}
------------------------- jdk1.4 output ----------------
The short column was accepted
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 >= 2
at java.util.Vector.elementAt(Vector.java:417)
at javax.swing.table.DefaultTableModel.addColumn(DefaultTableModel.java:522)
at javax.swing.table.DefaultTableModel.addColumn(DefaultTableModel.java:542)
at Test.main(Test.java:13)
------------------------- jdk1.3 output ----------------
The short column is accepted
The long column is accepted
======================================================================