Button.java - [comp1020 COMP 1020 SECTION[A01 INSTRUCTOR[Amirhossein Hosseinmemar NAME[Feng Boyu ASSIGNMENT[3 QUESTION[1 PuRPOSE[Button public class

Button.java - [comp1020 COMP 1020 SECTION[A01...

This preview shows page 1 out of 1 page.

/* * [comp1020] * * COMP 1020 SECTION [A01] * INSTRUCTOR: [Amirhossein Hosseinmemar] * NAME: [Feng Boyu] * ASSIGNMENT: [3] * QUESTION: [1] * * PuRPOSE: [Button] */ public class Button extends GUIelement { //The small distance from the right edge of the box to the label. private static final double MARGIN = 0.005; //Constructor public Button(double xc, double yc, double hw, double hh, String title) { super(xc,yc,hw,hh,title,false); //It's not highlighted to start with. }//constructor public void draw(){ StdDraw.setPenRadius(); //Make sure it's a standard narrow pen super.draw(); //Let the superclass draw the outer square if(highlighted) { //Fill the rectangle with LIGHT_GRAY StdDraw.setPenColor(StdDraw.LIGHT_GRAY);
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '15
  • Subroutine, public void draw, Amirhossein Hosseinmemar, Feng Boyu, public class Button

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture