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

JToolBar.createActionChangeListener() always returns null

XMLWordPrintable

    • kestrel
    • sparc
    • solaris_2.5.1



      Name: aaC67449 Date: 07/21/99



      The JToolBar.createActionChangeListener() always returns null, but should
      returns "a properly configured PropertyChangeListener".

      See javadocs:"

      protected PropertyChangeListener createActionChangeListener(JButton b)

            Returns a properly configured PropertyChangeListener which updates the control as changes
            to the Action occur. As of 1.3, this is no longer the preferred method, instead it is
            recommended to configure a control with an action using setAction(), and then adding that
            control directly to the Container.
      "

      This is incompatible change and the behavior of the method should be restored.

      -------------example -------------
      import javax.swing.*;
      import java.beans.*;

      public class Test {
          public static void main(String argv[]) {
       
              StubJToolBar c=new StubJToolBar();
                  
              if(c.stubCreateActionChangeListener(new JButton())!=null) {
                  System.out.println("Passed");
              } else {
                  System.out.println("Method returns null");
              }
         
          }

      }

      class StubJToolBar extends JToolBar {

          public PropertyChangeListener stubCreateActionChangeListener(JButton b){
              return createActionChangeListener(b);
          }
          
       }
      -------------JDK-1.3-K output ---------------
      Method returns null
      -------------jdk1.2.2 output ---------------
      Passed


      ======================================================================

            gsaab Georges Saab
            alisunw Ali Ali (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: