john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

applet simple draw line

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

public class Drawline extends Applet
{
    private static final long serialVersionUID = 1L;
    int width, height;


   public void init()
   {
      width = getSize().width;
      height = getSize().height;
      setBackground( Color.black );
   }

   public void paint( Graphics myGraphics )
   {
     myGraphics.setColor( Color.blue );
     for ( int i = 0; i < 10; ++i )
     {
         myGraphics.drawLine( width, height, i * width / 10, 0 );
     }
    } //end paint
} //end class

  • « read file replaceall servlet
  • applet bobbydoodle.java »

Published

Jun 9, 2011

Category

java

~53 words

Tags

  • applet 2
  • drawing 2
  • java 252