Hi,
I am looking for a simple way to implement such a basic program: a graphics editor that lets you click on three buttons, titled "Circle," "Square," and "Rectangle," and clicking each button should draw the corresponding shape anywhere the user desires (by clicking in a free spot in an empty drawing panel). I already know how to do it by using Graphics2D (clicking on a shape button and having it draw it on the panel), but the problem is, I need to be able to recall previously drawn shapes (perhaps by having them as separate objects that can be moved around using the mouse). The shapes can also be predefined sizes, as in the user just clicks circle and picks where to add it, and it simply adds the fixed size circle to the desired x y coordinates on the panel. What is the best way to implement the shapes: using actual image files (such as circle.jpg) or having them be drawn as Graphics2D objects, or as JLabels, or what? Any advice along with a simple example would be greatly appreciated.
Thanks in advance!
|