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

Registering Mouse Listeners on an Image  RSS feed

 
Stanley Gulavi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
Is it possible to register a MouseListener and MouseMotionListener on an java.awt.Image object to make it responsive to mouse events.
And if it is, how can I go about it?
Any help would be apprciated.
Thanks.
 
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
No.

However, you can use it as a background image for a panel, and then add the listeners to the panel.
Similarly you can use the image in a JLabel and then add the listeners to the label.

UI related.
Moving to a more appropriate forum.

...and Welcome to the Ranch
 
Stanley Gulavi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks maneesh.
and thanks for moving it here. Found answers for my next 3 questions.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!