Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: BlankClass.java
- * ---------------------
- * This class is a blank one that you can change at will. Remember, if you change
- * the class name, you'll need to change the filename so that it matches.
- * Then you can extend GraphicsProgram, ConsoleProgram, or DialogProgram as you like.
- */
- import java.awt.Color;
- import acm.graphics.GLine;
- import acm.graphics.GRect;
- import acm.program.*;
- public class BlankClass extends GraphicsProgram {
- public void run() {
- int screenWidth = getWidth();
- int screenHeight = getHeight();
- int leftX = 0;
- int middleY = screenHeight / 2;
- GLine line = new GLine(leftX, middleY, leftX + screenWidth, middleY);
- add(line);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement