Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld >> Java Beginner

Pages: 1
Regulator
newbie


Reged: 06/18/04
Posts: 27
What is the best way to implement such a program?
      #186118 - 09/28/08 09:13 PM

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!


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2925

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5