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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

double-buffered and mouse dragging

Status
Not open for further replies.

cindyg919

Programmer
Feb 10, 2001
17
US
hi please someone help me!!!
i am writing a program for connect the dots game.....
i am stuck on the mouse dragging. if you click on a dot and drag it to the destination you want it to be. i dont know how to do this. i am not using Point class.
also how do I double buffer?????
please help.....ASAP
thank-you
 
i mean double buffer the graphics........to be precise
 
You need to over ride paint() or paintComponent() method for drawing your 'DOTs' at specified positions.
Positions can be obtained from MouseEvent.getX() & MouseEvent.getY() methods in the listener which I presume u have added over the container that holds these 'dots'.

else try using swing components as they are double buffered by default. For AWT components u have to write ur own code for the same.

Gaurav

gaurav
yadav_gaurav@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top