Reputation: 53
g.drawString("String",50,50);
I would like to add MouseListener to this graphic element.
public void mouseEntered(MouseEvent e) {
saySomething("Mouse entered", e);
}
public void mouseExited(MouseEvent e) {
saySomething("Mouse exited", e);
}
is there any straightforward way to do it, or I have manually find element position?
thanks
Upvotes: 1
Views: 97
Reputation: 285460
Suggestions:
For example please look at my previous answers with sample code in the links below:
Upvotes: 3