g.translate(this.getX(),this.getY()); g.setClip(0, 0, getWidth(), getHeight()); super.paint(g); g.translate(-this.getX(),-this.getY()); g.setClip(clip);
Rectangle clipRect = g.getClipBounds(); Rectangle newClipRect = new Rectangle(this.getX(), this.getY(), getWidth(), getHeight()); if (clipRect!= null) newClipRect = newClipRect.intersection(clipRect); if (!newClipRect.isEmpty()) { newClipRect.setLocation(-this.getX(), -this.getY());  g.translate(this.getX(),this.getY()); g.setClip(newClipRect); super.paint(g); g.translate(-this.getX(),-this.getY()); g.setClip(clip); }
		    public void paint(Graphics g) {				Shape clip = g.getClip();				g.translate(this.getX(),this.getY());				g.setClip(0, 0, getWidth(), getHeight());				super.paint(g);				g.translate(-this.getX(),-this.getY());				g.setClip(clip);		    }