Draw Shapes and Walls, and Remove Walls

Learn to draw shapes like rectangles and circles, and add methods to draw walls in the maze.

Setting a cell’s preferred size

The window did not show the entire line for the cell because the cell’s size has not been set yet.

  1. In Cell.java, add a public method called getPreferredSize(). It should take no parameters and return a Dimension.
  2. Create a new Dimension object called size, SIZE wide and SIZE high.
  3. Return size.
  _________________ getPreferredSize(________) {
    ________________ size = new __________________;
    return ________;

Get hands-on with 1200+ tech skills courses.