/[classpath]/classpath/javax/swing/JMenuItem.java
ViewVC logotype

Diff of /classpath/javax/swing/JMenuItem.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by rabbit78, Fri Jul 15 11:41:06 2005 UTC revision 1.19 by langel, Mon Sep 26 20:53:00 2005 UTC
# Line 255  public class JMenuItem extends AbstractB Line 255  public class JMenuItem extends AbstractB
255    }    }
256    
257    /**    /**
258     * Sets accelerator for this menu item.     * Sets the key combination which invokes the menu item's action
259     *     * listeners without navigating the menu hierarchy. Note that when the
260       * keyboard accelerator is typed, it will work whether or not the
261       * menu is currently displayed.
262       *
263     * @param keystroke accelerator for this menu item.     * @param keystroke accelerator for this menu item.
264     */     */
265    public void setAccelerator(KeyStroke keystroke)    public void setAccelerator(KeyStroke keystroke)
# Line 276  public class JMenuItem extends AbstractB Line 279  public class JMenuItem extends AbstractB
279      super.configurePropertiesFromAction(action);      super.configurePropertiesFromAction(action);
280    
281      if (! (this instanceof JMenu) && action != null)      if (! (this instanceof JMenu) && action != null)
282        setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY)));        {
283            setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY)));
284            super.registerKeyboardAction(action, accelerator,
285                                         JComponent.WHEN_IN_FOCUSED_WINDOW);
286          }
287    }    }
288    
289    /**    /**

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26