Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display image in mouse position

 
Nirmal JeyaChandra
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I display a image where ever I click the mouse on the screen. pls help.

If I give drawImage inside for loop and give the mouse cordinate to drawimage method it shows the image only once.

Please suggest me to get multiple time.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nirmal JeyaChandra:
How can I display a image where ever I click the mouse on the screen. pls help.

If I give drawImage inside for loop and give the mouse cordinate to drawimage method it shows the image only once.

Please suggest me to get multiple time.


One way to do it would be to maintain an ArrayList of Point objects that gets added to each time you click the mouse. Then in the paint method, you could simply iterate through the ArrayList and draw the image at each point.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic