Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. /*
  2. * File: BlankClass.java
  3. * ---------------------
  4. * This class is a blank one that you can change at will. Remember, if you change
  5. * the class name, you'll need to change the filename so that it matches.
  6. * Then you can extend GraphicsProgram, ConsoleProgram, or DialogProgram as you like.
  7. */
  8.  
  9. import java.awt.Color;
  10.  
  11. import acm.graphics.GLine;
  12. import acm.graphics.GRect;
  13. import acm.program.*;
  14.  
  15. public class BlankClass extends GraphicsProgram {
  16. public void run() {
  17. int screenWidth = getWidth();
  18. int screenHeight = getHeight();
  19. int leftX = 0;
  20. int middleY = screenHeight / 2;
  21.  
  22. GLine line = new GLine(leftX, middleY, leftX + screenWidth, middleY);
  23. add(line);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement