Title: Drawing Basics
Course: CPS 161: An Intro to Programming with Java - DL MM MASTER > Section: Learning Units - Bb

Presentations and Videos

- Drawing Basics lecture video (Time: 32:50)
- Drawing Basics document

- A simple JFrame based program is built, making use of setSize, setVisible, etc. in the constructor.
- In the paint method, the Graphics class can be used to draw objects on the screen. Methods demonstrated include: setColor, fillRect, drawRect, fillOval, drawLine, fillRoundRect, drawString.
- The basic coordinate system is described. Using getSize, you can always discover the size of your screen.
- The Color class is necessary to change the colors used for drawing on the screen. There are several constructors for creating the desired colors needed.