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

SwingEventMonitor - installListeners(Component , int ) - CELLEDITOR - bug

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      When adding a CellEditorListener via SwingEventMonitor.addCellEditorListener, the method never succeedes. This is happening because there is a typo inside function installListeners(Component, int), on case EventID.CELLEDITOR.

      // Look for components which support the getCellEditor method
                      // (e.g. JTable, JTree)
                      //
                      try {
                          getCellEditorMethod = c.getClass().getMethod(
                              "getCellEditorMethod", nullClass);

      Instead of "getCellEditorMethod", the method searched for should have only been "getCellEditor".
      The consequence is that targets like JTables and JTrees are never found.

      -> It looks like it was never tested :)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Add a cellEditorListener via SwingEventMonitor to listen to the editor of a JTable.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Listener methods "editingStoped" and "editingCanceled" are called when such actions happen.
      ACTUAL -
      Nothing happens.

      FREQUENCY : always


            abhiscxk Abhishek Kumar
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: