Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4511992

EventHandler will throw ArrayIndexOutOfBoundsException in can't find method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.4.0
    • client-libs
    • 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);
          }
      }

            svioletsunw Scott Violet (Inactive)
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: