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.
- In
Cell.java
, add a public method calledgetPreferredSize()
. It should take no parameters and return a Dimension. - Create a new
Dimension
object calledsize
,SIZE
wide andSIZE
high. - Return
size
.
...
_________________ getPreferredSize(________) {
________________ size = new __________________;
return ________;
}
...
Get hands-on with 1200+ tech skills courses.