Skip to content

Instantly share code, notes, and snippets.

Created January 19, 2013 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4574797 to your computer and use it in GitHub Desktop.
Save anonymous/4574797 to your computer and use it in GitHub Desktop.
Add a static nested class ColorPanel which creates a panel (and listeners) for two Color choice boxes, one for the line color and one for the fill color. Provide at least 8 colors. Use the same techniques you learned in previous lessons. These Choice boxes should work; if a user chooses a line color of Blue, the model should be updated so that the next figure drawn will have a Blue line color, etc. The choice boxes should be properly labeled. A good place for this inner class is in the ControlsPanel or MainPanel. The idea is to put the class close to where it is used to make maintenance easier.
Modify the ButtonPanel's Clear button so that it no longer uses an anonymous inner class, but rather, a local inner class. Its functionality should not change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment