1 Reply Latest reply: Apr 16, 2013 7:28 AM by se*328623*78 RSS

    Unfocussing links

      I have an "About" window with some links there.
      When the window opens, the first link is automatically focussed (surrounded with a dotted box).
      I am fine with the focussing style, but I would like to avoid that the first link is automatically focussed when the window is opened. Instead, I would like that it receives the focus the first time I push the TAB keyword. Also, that after traversing all the links with TAB, it should comeback to an unfocussed state if TAB is pushed again.
      Any idea if this can be done ?

      I tried invoking requestFocus() at start to non-editable components in the window (trying to remove the focus on the link), but it does not seem to work.
        • 1. Re: Unfocussing links
          I have partially solved sending in the constructor of the pane "setFocusTraversable(true)" and then "requestFocus()" to an arbitrary label in the pane.
          Please someone tell me in case is a better way to implement the focus life cycle I want.
          Although this approach seems to be kind of working, it would not work if I do not have a label or something equivalent in the screen (for example if all what I have are links).

          I also tried sending "setFocusTraversable(true)" and "requestFocus()" to the pane containing the links. At least no link has the focus when the screen is shown, but if I push the TAB they do not receive the focus neither :(

          Any feedback will be appreciated.

          Edited by: se**** on Apr 16, 2013 5:26 AM