-
Bug
-
Resolution: Duplicate
-
P5
-
None
-
1.4.0
-
None
-
sparc
-
solaris_7
If the EventHandler can't find a method with the specified name passed, and you don't pass in a property name, you'll get an ArrayIndexOfBoundsException instead of an error indicating the method couldn't be found:
import javax.swing.event.*;
import javax.swing.*;
import java.beans.*;
public class Test {
public static void main(String argv[]) {
new Test();
}
public Test() {
JTree tree = new JTree();
tree.addTreeSelectionListener((TreeSelectionListener)EventHandler.
create(TreeSelectionListener.class, this, "selectionChanged"));
tree.setSelectionRow(0);
}
}
import javax.swing.event.*;
import javax.swing.*;
import java.beans.*;
public class Test {
public static void main(String argv[]) {
new Test();
}
public Test() {
JTree tree = new JTree();
tree.addTreeSelectionListener((TreeSelectionListener)EventHandler.
create(TreeSelectionListener.class, this, "selectionChanged"));
tree.setSelectionRow(0);
}
}
- duplicates
-
JDK-6204552 EventHandler documentation and exception handling problems
-
- Resolved
-