All pastes #357875 Raw Edit

IPJ source

public java v1 · immutable
·published 2007-02-15 23:22 UTC
rendered paste body
/* * RedCircle.java * * Author: Craige * * Created on February 15, 2003, 6:02 PM * * Comments: RedCircle Project. *           Pg. 88 - IPJ */import java.awt.*;import hsa.Console;public class RedCircle{  static Console c;    /**   * @param args the command line arguments   */  public static void main(String[] args)  {    c = new Console();    int xc = c.getWidth() / 2;    int yc = c.getHeight() / 2;    int radius = yc;        circle(xc, yc, radius, Color.red);  }    /**   * @param xc Center of circle on x axis   * @param xy Center of circle on y axis   * @param radius Circle radius   * @param clr Circle color   */  public static void circle(int xc, int yc, int radius, Color clr)  {    int width = radius * 2;    int height = radius * 2;        // get position of top left coordinate    int x = xc - radius;    int y = yc - radius;        c.secColor(clr);    c.drawOval(x,y,width,height);  }  }