-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0
-
kestrel
-
sparc
-
solaris_2.5.1
Name: aaC67449 Date: 07/21/99
The JComponent.AccessibleJComponent.accessibleContainerHandler variable
is not used now.
So an AccessibleContainerHandler listener is not created and not added to The JComponent.
Thus the PropertyChangeEvent is not generated when children added/removed, but should.
javadoc says:"
protected class JComponent.AccessibleJComponent.AccessibleContainerHandler
extends Object
implements ContainerListener
Fire PropertyChange listener, if one is registered, when children added/removed.
"
This is incompatible change and the behavior should be restored,
namely the accessibleContainerHandler variable should contain a correct listener
and the listener should be added to JComponent.
See example.
------------- example --------------
import javax.swing.*;
import javax.accessibility.*;
import java.beans.*;
public class Test {
public static void main(String argv[]) {
JPanel c=new JPanel();
MyPropertyChangeListener listener = new MyPropertyChangeListener();
c.getAccessibleContext().addPropertyChangeListener(listener);
c.add(new JButton());
if(listener.added) {
System.out.println("Passed");
} else {
System.out.println("Method does not notify listener");
}
}
}
class MyPropertyChangeListener implements PropertyChangeListener {
public boolean added = false;
public void propertyChange(PropertyChangeEvent evt) {
added = true;
}
}
------------- JDK1.3L output ---------------
Warning: JIT compiler "sunwjit" not found. Will use interpreter.
Method does not notify listener
------------- JDK1.3F output ---------------
Passed
======================================================================