Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #5144

Re: Where is the actual menu key processing in Swing or the LaF?

From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.gui
Subject Re: Where is the actual menu key processing in Swing or the LaF?
Date 2012-05-25 10:18 -0400
Organization A noiseless patient Spider
Message-ID <jpo4aq$ngr$1@dont-email.me> (permalink)
References <menu-20120525135656@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 05/25/2012 08:21 AM, Stefan Ram wrote:
>    When there are two menus with two entries each (no
>    sub-menus) and one menu is visible and the right-arrow
>    (right-cursor) key is being pressed, the next menu will be
>    opened. But (even using the Windows LaF) the first entry of
>    the menu just opened will /not/ be selected, while I want in
>    /to be/ selected.
>
>    So, I got the idea that I might overwrite some Swing class
>    or or some such. But where in Swing or in the LaF is this
>    actually implemented that the right-arrow key does close the
>    current menu and does open the next menu (in the case
>    described above)?
>
>    I have been looking in JMenu.java, JMenuItem.java and some
>    of the LaF-specific classes, but was not able to find that
>    spot. One gets lost in many delegations. One class delegates
>    to the other, but I do not find the spot where the actual
>    connection of right-arrow to next-menu operation is done.

Have you looked about Focus Traversal Policy?

>
> ----------------------------------------
>    File               Edit
>    >  New
>      Open ...
>      Save
>      Save As ...
>      Exit
>
>    Above, »New« is selected. Now, assume that the user pressed
>    [-->], then I want to see
>
> ----------------------------------------
>    File               Edit
>                       >  Undo
>                         Redo
>                         Cut
>                         Copy
>                         Paste
>
>    with »Undo« selected. But instead, all I get is:
>
> ----------------------------------------
>    File               Edit
>                         Undo
>                         Redo
>                         Cut
>                         Copy
>                         Paste
>
>    with »Undo« /not/ selected. (One can select this
>    with the down-arrow key, then.)
>

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar


Thread

Re: Where is the actual menu key processing in Swing or the LaF? Jeff Higgins <jeff@invalid.invalid> - 2012-05-25 10:18 -0400
  Re: Where is the actual menu key processing in Swing or the LaF? Jeff Higgins <jeff@invalid.invalid> - 2012-05-27 18:12 -0400
    Re: Where is the actual menu key processing in Swing or the LaF? Jeff Higgins <jeff@invalid.invalid> - 2012-05-27 19:11 -0400
      Re: Where is the actual menu key processing in Swing or the LaF? Jeff Higgins <jeff@invalid.invalid> - 2012-05-27 19:33 -0400
      Re: Where is the actual menu key processing in Swing or the LaF? Jeff Higgins <jeff@invalid.invalid> - 2012-05-27 21:20 -0400

csiph-web