code: @Deprecated
    public static WindowFocusListener createAndInstallRepaintWindowFocusListener(Window window)
    {
      WindowFocusListener windowFocusListener = new WindowFocusListener()
      {
        public void windowGainedFocus(WindowEvent e)
        {
          e.getWindow().repaint();
        }
  
        public void windowLostFocus(WindowEvent e)
        {
          e.getWindow().repaint();
        }
      };
      window.addWindowFocusListener(windowFocusListener);
      return windowFocusListener;
    }
docs: Creates and installs a {@link WindowFocusListener} on the given
  {@link Window} which calls the {@code Window}'s {@code repaint()} method on
  focus state changes.
  
  @param window
  the {@code Window} to repaint on focus state changes.
  @return the listener installed.
  @deprecated use the more targeted
  {@link WindowUtils#installJComponentRepainterOnWindowFocusChanged(JComponent)}
  method.