//CircDemo6 //demonstrates Circle6 //static stuff import java.awt.*; import java.applet.*; import Circle6; public class CircDemo6 extends Applet{ Circle6 myCirc; //create here, but do not add any values yet public void init(){ this.setLayout(new GridLayout(0,2)); myCirc= new Circle6(); add (new Label ("Radius: ")); add (new Label (myCirc.getRadString())); add (new Label ("PI: ")); add (new Label (String.valueOf(myCirc.PI))); add (new Label ("Small: ")); myCirc = new Circle6(Circle6.SMALL); add (new Label (myCirc.getRadString())); add (new Label ("Medium: ")); myCirc = new Circle6(Circle6.MEDIUM); add (new Label (myCirc.getRadString())); add (new Label ("Large: ")); myCirc = new Circle6(Circle6.LARGE); add (new Label (myCirc.getRadString())); add (new Label("Circumf of 20:")); //note the way the line is built on several lines //note also that no instance was created. //This is possible because the circumf method was declared //as a static method. add (new Label(String.valueOf( Circle6.circumf( (float) 20)))); } // end init } // end class