Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

repainting during mouseDragged(MouseEvent e)

Status
Not open for further replies.

whodaman

Programmer
May 23, 2001
60
CA
Hi, let's say I want to draw a rectangle that selects an area. And when the user drags the mouse, I can only draw the rectangle only when the mouse is released. And e.getX() would only get the last value of MouseDragged. How can I fix this?
Pretty much for each value the mouse is draged at, I want to be able to do something.

Thank you
 
I think I got how to do it. But somehow it seems a little slow : (

Is there a way one can make it refresh faster?

My appologies for confusing everyone...
 
What's exactly the problem? How about sending me the code?

Charles

meadandale@yahoo.com
 
Well, I just went through my code again and found that it kept calling my function that has lots of computations. Thus it makes it quite slow. It's annoying but it has to do it. :( Somehow it seems that when I use swing, it is somewhat faster than AWT. I don't know why...

Thanks for your offer anyway : )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top