I have a problem with removing/replacing items in both jdk1.1.6-v2-libc
and jdk1.1.6-v2-glibc. The items remains in the list when removed, and
replacing an item results in an extra item in the list. The weird thing is
that selecting these bogus items results in an ArrayOutOfBoundsException.
I'm running XFree86 3.3.2 and I'm using the static linked Motif and
Fvwm2 on RedHat 5. The reason for using the libc version with RedHat is,
that danish characters are severely broken in the glibc version (resulting
in weird backspaces instead of the characters), but seems to be working in
the libc version *sigh*.
The same program runs fine under Solaris and Windows.
The problem is illustrated by the small program attached. The first item
on the list should be deleted when pushing the button. Then the first item
is reselected and the text in the item outputted to stdout. Obviously this
should result in a shrinking list, and it is also shrinking behind the
scenes (as can be seen on the stdout) but not on the (my) screen...
Please try it out, to see if it works for you.
Brian Pedersen, DSP Student _/ _/_/_/ _/_/_/ _/
Applied Signal Processing and Implementation _/_/ _/ _/ _/ _/
Department of Communication Technology _/ _/ _/_/_/ _/_/_/ _/
Aalborg University, Denmark _/_/_/_/ _/ _/ _/
URL: http://www.danbbs.dk/~kibria/brian/ _/ _/ _/_/_/ _/ _/
import java.awt.*;
import java.awt.event.*;
public class DelTest{
public static void main(String[] args){
Frame f = new Frame();
final List l = new List(20);
Button b = new Button("Delete first Item");
l.addItem("1");
l.addItem("2");
l.addItem("3");
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
l.delItem(0);
l.select(0);
System.out.println(l.getSelectedItem());
}
});
f.setLayout(new BorderLayout());
f.add("Center",l);
f.add("South",b);
f.pack();
f.show();
}
}
DelTest.class
DelTest$1.class