-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.3.0
-
sparc
-
solaris_2.6
Name: sdC67446 Date: 09/20/99
The method
public void setSize(int index, int size)
of class
javax.swing.SizeSequence
has perverse idea of right behaviour if 'index'<0:
the method adds 'size' to first size cell.
The doc says:
--------------------------------------------------
public void setSize(int index,
int size)
Sets the size of the specified entry.
Parameters:
index - the index corresponding to the entry
size - the size of the entry
The demo test:
--------------------------------------------------
import javax.swing.SizeSequence;
public class Test {
public static void main(String argv[]) {
int[] sizes = {1000, 2000, 3000};
SizeSequence ss = new SizeSequence();
ss.setSizes(sizes);
System.out.println("before:");
for (int i=0; i<sizes.length; i++) {
System.out.println(i+": "+ss.getSize(i));
}
ss.setSize(-1, 777);
System.out.println("after:");
for (int i=0; i<sizes.length; i++) {
System.out.println(i+": "+ss.getSize(i));
}
}
}
--------------------------------------------------
before:
0: 1000
1: 2000
2: 3000
after:
0: 1777
1: 2000
2: 3000
--------------------------------------------------
======================================================================