Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make all my graphics selectable and doubleclick with event?  RSS feed

 
Ana Suvari
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do i have to turn the images into buttons with images?

But i don't think i want that.

If it's selected, I would like to but a border around the image to show it is selected.

Then if it's double-click, i want to put some action code on the selected item.

Does anyone know of a good link example of what I am trying to do?

Thanks ahead.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here's a simple demo using JLabels

it's just as simple if you're drawing the images to coordinates in a panel,
you just compare the mouseEvent.getPoint() to the image's rectangle

 
Ana Suvari
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much for the example. I'll try it out and let you know if i get into problems.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!