previous | index | next

Task 1: Add a Color Property to the Car Bean

As it stands, the car bean does not have a color property, so it is drawn in the default color of black.

You must add a color property so that the CarBean class passes this test: CarBeanTest.java.

(In the NetBeans project the calls to setColor are initially commented out so that NetBeans doesn't complain. You will need to uncomment them.)

Note that the Graphics2D object in paintComponent must have its color set appropriately before drawing.

The test succeeds if it produces these message dialogs:


previous | index | next