code: protected Rectangle getRectOnScreen (JComponent comp)
      {
          Rectangle r = comp.getVisibleRect();
          Point p = comp.getLocationOnScreen();
          r.translate(p.x, p.y);
          return r;
      }
docs: Find the rectangular area that is visible in screen coordinates
  for the given component.