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

JRootPane's defaultPressAction and defaultReleaseAction fields are never used

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: aaC67449 Date: 05/21/99


      JRootPane's defaultPressAction and defaultReleaseAction fields are never used in code and does not contain any object but should contain default actions for defaultButton events.

      javadoc says: "
         * The button that gets activated when the pane has the focus and
           * a UI-specific action like pressing the Enter key occurs.
           */
          protected JButton defaultButton;
        
          /** The action to take when the defaultButton is pressed.
           * @deprecated As of JDK version 1.3.
           * @see #defaultButton
           */
          protected DefaultAction defaultPressAction;

          /** The action to take when the defaultButton is released.
           * @deprecated As of JDK version 1.3.
           * @see #defaultButton
           */
          protected DefaultAction defaultReleaseAction;
      "
      They contained correct values in jdk1.2.2

      ---------------- example ---------------
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      public class Test {
       
         public static void main(String argv[]) {
         
             StubJRootPane rp = new StubJRootPane();
             rp.setDefaultButton(new JButton());

             if(rp.getDefaultReleaseAction()!=null) {
                 System.out.println("PASSED");
             } else {
                 System.out.println("FAILED");
             }
        }
       
      }

      class StubJRootPane extends JRootPane {
           public Object getDefaultReleaseAction() {
               return defaultReleaseAction;
           }

      }
      -------------jdk1.3 output---------
      FAILED
      ------------jdk1.2.2 output -------
      PASSED
       

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: