private void paintTiledIcon(Component c,Graphics g,ImageIcon icon,int sX,int sY,int width,int height){
  int tileW=icon.getIconWidth();
  int tileH=icon.getIconHeight();
  width+=sX;
  height+=sY;
  for (int x=sX; x <= width; x+=tileW) {
    for (int y=sY; y <= height; y+=tileH) {
      icon.paintIcon(c,g,x,y);
    }
  }
}

private void paintTiledIcon ( Component c , Graphics g , ImageIcon icon , int sX , int sY , int width , int height ) { int tileW = icon . getIconWidth ( ) ; int tileH = icon . getIconHeight ( ) ; width += sX ; height += sY ; for ( int x = sX ; x <= width ; x += tileW ) { for ( int y = sY ; y <= height ; y += tileH ) { icon . paintIcon ( c , g , x , y ) ; } } }
paints a tiled icon .
