import java.applet.Applet; 
import java.awt.*; 

    public class CopyImageExample extends Applet
      { 
      public void paint (Graphics g) 
        { 
        Font fFont;                      
        FontMetrics fm;
        String s;
        int x, y;
        int w, h;
        int i, j;

        fFont = new Font ("Helvetica", Font.ITALIC | Font.BOLD, 36);
        g.setFont (fFont);
        fm = g.getFontMetrics ();

        s = "Java";
        x = 0;
        y = fm.getLeading () + fm.getAscent ();
        w = fm.stringWidth (s);
        h = fm.getHeight () - fm.getLeading ();

        g.drawString (s, x, y);

        for (i = 0; i < 4; i++)
          {
          for (j = 0; j < 5; j++)
            {
            g.copyArea (0, 0, w, h, w * i, h * j);
            }
          }
        } 
      } 

