Monday, April 30, 2001 09:41 PM
Add a MouseListener to the shape (assuming that shape is a subclass of component). Else you will have to implement the equivalent using the
MouseMotionListener on the component on
which the shape is drawn. For arbitrary shapes detecting if the mouse is
inside or outside could be very complex. I think Java2D has special methods for it.
Start a timer in the mouseEntered callback. User the javax.swing.Timer
class for that.
public Timer(int delay,
If the timer expires
it will call the ActionListener's
actionPerformed(...) method. Show your
notes windows here.
If the mouseExited(...) is called before the timer expires cancel the timer.