@Override
    public void setBounds(int x, int y, int width, int height) {
      final Container p = myTransparentPane;
      if (p != null) {
        Rectangle bounds = new Rectangle(p.getWidth() - width, p.getHeight() - height);
        JBInsets.removeFrom(bounds, getInsets());

        x = bounds.width < 0 ? bounds.width / 2 : MathUtil.clamp(x, bounds.x, bounds.x + bounds.width);
        y = bounds.height < 0 ? bounds.height / 2 : MathUtil.clamp(y, bounds.y, bounds.y + bounds.height);
      }
      super.setBounds(x, y, width, height);

      if (RemoteDesktopService.isRemoteSession()) {
        shadow = null;
      }
      else if (shadow == null || shadowWidth != width || shadowHeight != height) {
        shadow = ShadowBorderPainter.createShadow(this, width, height);
        shadowWidth = width;
        shadowHeight = height;
      }
    }
@Override
    public void setBounds(int x, int y, int width, int height)