Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Applet

Thread Tools


Miguel De Anda
Posts: n/a
Does anybody know of a place where I can get sample code to do the

Create a Swing/Awt/Applet that lets a person add shapes to the canvas and
then move/size them with the mouse? If using the mouse to move/size them is
too difficult, I don't mind have a few fields where they set the

I guess maybe a simpler question would be, what's the easiest way to have
multiple shapes on a canvas and move one of them without having big nasty

Reply With Quote
Gary Thomas
Posts: n/a
I usually just redraw the whole image, and it's fast enough for me. If
you have a really complex image I could see refreshing a portion, but
it really depends on what your needs are. I'd try without it first.

Good luck,


Miguel De Anda wrote:
>>Use a JPanel to draw on, it is double-buffered by default. You
>>shouldn't see flickering as with an AWT Canvas.
>> Take care,
>> Gary

> Thanks, I'll start playing from there.
> Do you think that clearing the whole screen is the way to go or is there a
> simple way to only redraw the changes (where it moved from, and where it
> goes to)

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
struts/jsp/applet: sessionid doesn't work in applet for macs only Blah Blah Java 0 08-13-2003 02:51 AM
Cool Applet Cool Applet Alisher Fatykhov Java 1 08-06-2003 04:32 AM
Re: newbie: Join JApplet & Applet in one applet Andrew Thompson Java 0 08-05-2003 01:41 PM
Re: play wave files using java.applet.Applet webster Java 0 07-20-2003 01:51 PM
applet vs. canvas in applet Rob Love Java 1 07-07-2003 10:07 PM