Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can i have a picture as a background and have coordinate on that picture using Java ?  RSS feed

 
motress zlting
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i have a picture as a background and have coordinate on that picture using Java ?
i have done the browse and display picture function in my laptop, but now i don know how can i set a coordinate for
that picture ? However, that coordinate should be invisible to user , so when mouse move over the picture ,it shows the coordinate .
That is really difficult for me as i'm newbie in java .... Someone please help me.......
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/java/BackgroundImageOnJPanel

You will need a MouseMotionListener. On the mouseMoved you can get the mouse coordinates and display them as a tooltip.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!