Component focusComp = (comp == null) ? getGlobalFocusOwner () : comp; Container focusCycleRoot = focusComp.getFocusCycleRootAncestor (); FocusTraversalPolicy policy = focusCycleRoot.getFocusTraversalPolicy ();  Component previous = policy.getComponentBefore (focusCycleRoot, focusComp); if (previous != null) previous.requestFocusInWindow ();
if (comp != null) comp.transferFocusBackward();
  public void focusPreviousComponent (Component comp)  {    Component focusComp = (comp == null) ? getGlobalFocusOwner () : comp;    Container focusCycleRoot = focusComp.getFocusCycleRootAncestor ();    FocusTraversalPolicy policy = focusCycleRoot.getFocusTraversalPolicy ();    Component previous = policy.getComponentBefore (focusCycleRoot, focusComp);    if (previous != null)    previous.requestFocusInWindow ();  }