Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

trying to make an applet where you can draw

  Asked By: Jody    Date: May 15    Category: Java    Views: 841
  

I have run in to a problem while trying to make an applet where you
can draw. I have it so you can drag the mouse and leave your drawing
line, however, it will dissappear when any other action in the applet
is made. For example, I can make one line but if I perform an action
that requires the applet to call "repaint()" the line with vanish!
This is preventing me from changing line color and size. I was
wondering if anyone here would have any advice for me.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Ora Hanson     Answered On: May 15

Where are you keeping the internal representation of your line? When
you draw  your line  the first time, you have to keep an internal
representation of the line. When you "repaint()" you call  a routine
which redraws that line on your canvas based upon your internal
representation.

 
Didn't find what you were looking for? Find more on trying to make an applet where you can draw Or get search suggestion and latest updates.




Tagged: