private void drawImage(Graphics g,int yLoc,boolean getScaled){
  int xLoc=100;
  int delta=(int)(SCALE_FACTOR * FULL_SIZE);
  if (getScaled) {
    for (int scaledSize=FULL_SIZE; scaledSize > 0; scaledSize-=delta) {
      Image scaledImage=originalImage.getScaledInstance(scaledSize,scaledSize,Image.SCALE_AREA_AVERAGING);
      g.drawImage(scaledImage,xLoc,yLoc + (FULL_SIZE - scaledSize) / 2,null);
      xLoc+=scaledSize + 20;
    }
  }
 else {
    for (int scaledSize=FULL_SIZE; scaledSize > 0; scaledSize-=delta) {
      g.drawImage(originalImage,xLoc,yLoc + (FULL_SIZE - scaledSize) / 2,scaledSize,scaledSize,null);
      xLoc+=scaledSize + 20;
    }
  }
}

private void drawImage ( Graphics g , int yLoc , boolean getScaled ) { int xLoc = 100 ; int delta = ( int ) ( SCALE_FACTOR * FULL_SIZE ) ; if ( getScaled ) { for ( int scaledSize = FULL_SIZE ; scaledSize > 0 ; scaledSize -= delta ) { Image scaledImage = originalImage . getScaledInstance ( scaledSize , scaledSize , Image . SCALE_AREA_AVERAGING ) ; g . drawImage ( scaledImage , xLoc , yLoc + ( FULL_SIZE - scaledSize ) / 2 , null ) ; xLoc += scaledSize + 20 ; } } else { for ( int scaledSize = FULL_SIZE ; scaledSize > 0 ; scaledSize -= delta ) { g . drawImage ( originalImage , xLoc , yLoc + ( FULL_SIZE - scaledSize ) / 2 , scaledSize , scaledSize , null ) ; xLoc += scaledSize + 20 ; } } }
this approach uses either the getscaledinstance ( ) approach to get each new size or it scales on the fly using drawimage ( ) .
