The_Kingpin08
asked on
Java paint graphics generator
Hi everybody,
I'm currently working with applet and needs to make a lot of graphics, so I just wanted to know if anyone had a porgram that let the user paints and then generates the code of the graphics.
Thanks for your help,
Frank
I'm currently working with applet and needs to make a lot of graphics, so I just wanted to know if anyone had a porgram that let the user paints and then generates the code of the graphics.
Thanks for your help,
Frank
ASKER
This is kind of what I'm looking for, except that when I have made all my graphics, I'd like to be given the code of those graphics...
ie. If I draw 4 rectangles and a circle, I'd like to have something like:
g.drawRect(10, 90, 150, 100);
g.drawRect(40, 120, 150, 100);
g.drawRect(70, 150, 150, 100);
g.drawRect(100, 1800, 150, 100);
g.drawOval(180, 20, 260, 80);
[...]
Thanks, Frank
ie. If I draw 4 rectangles and a circle, I'd like to have something like:
g.drawRect(10, 90, 150, 100);
g.drawRect(40, 120, 150, 100);
g.drawRect(70, 150, 150, 100);
g.drawRect(100, 1800, 150, 100);
g.drawOval(180, 20, 260, 80);
[...]
Thanks, Frank
You need to save each Shape into a collection each time drawing takes place. Can you just post the part of your code where that happens?
ASKER
well I haven't done anything yet...
When I did some Java back in college, I use to have a small application that would let me draw some shape and generate the Applet code once I was done. That's exactly what I would need, since I would have all my shapes already and would only have to add some code.
Don't know if I'm being clear, but I'm looking for a way to avoid losing time with the graphics...
Thanks, Frank
When I did some Java back in college, I use to have a small application that would let me draw some shape and generate the Applet code once I was done. That's exactly what I would need, since I would have all my shapes already and would only have to add some code.
Don't know if I'm being clear, but I'm looking for a way to avoid losing time with the graphics...
Thanks, Frank
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.oreilly.com/catalog/javanut/examples/