Einstein Appleten [Lewis/Loftus, s93]

Above this text you should see a picture of a some shapes and a quote by Albert Einstein. This picture is generated by a Java applet. If you don't see the picture, it may be because your browser is not set up to process Java applets, or because the bytecode version of the applet is not stored in the same location as this web page.


Java koden till appleten ovan

import java.applet.Applet;
import java.awt.*;

public class Einstein extends Applet
{
   //-----------------------------------------------------------------
   //  Draws a quotation by Albert Einstein among some shapes.
   //-----------------------------------------------------------------
   public void paint (Graphics page)
   {
      page.drawRect (50, 50, 40, 40);    // square
      page.drawRect (60, 80, 225, 30);   // rectangle
      page.drawOval (75, 65, 20, 20);    // circle
      page.drawLine (35, 60, 100, 120);  // line

      page.drawString ("Out of clutter, find simplicity.", 110, 70);
      page.drawString ("-- Albert Einstein", 130, 100);
   }
}