if (root == null) throw new IllegalArgumentException ();  if (!root.isVisible () || !root.isDisplayable ()) return null;  if (accept (root)) return root;  Component[] componentArray = root.getComponents ();  for (int i = componentArray.length - 1; i >= 0; i--) { Component component = componentArray [i];  if (accept (component)) return component;  if (component instanceof Container) { Component result = getLastComponent ((Container) component);  if (result != null) return result; } }
  public Component getLastComponent(Container root)  {    return null;  }