I don't know if this is the best way to do it, but what I did is I created a variable in the figure class for the color as well as a setter method. Then I added a listener to the color picker which got the prototype to clone for each shape tool, and then I set the color to the color picker's color. Then the last thing I did, was in the draw method of the figure class, I added the line g.setStroke(color); before the drawShape method call.