how to assign tooltip to shpe?

i have used shape to draw line2d but in my application there is needof tooltip on that shapei m not getting any solution so please give me some hint i u have some idea..thanks in advancebye
[231 byte] By [Anand_Agrawala] at [2007-11-26 18:05:47]
# 1

You will need to add a mouse motion listener to the component that is responsible for painting your collection of shapes. Within that listener, detect if the cursor falls within a shape by using the Shape.contains() method. Set the tooltip text of the component accordingly.

Note that a Line2D has no area so contains() will only return true for points which lie exactly on the line. You may wish to store a stroked version of shapes to give some 'fuzziness' (see BasicStroke and Stroke.createStrokedShape()).

itchyscratchya at 2007-7-9 5:36:28 > top of Java-index,Desktop,Core GUI APIs...
# 2
but sir i have not find any method like setTooltip for shape classMessage was edited by: Anand_Agrawal
Anand_Agrawala at 2007-7-9 5:36:28 > top of Java-index,Desktop,Core GUI APIs...
# 3
There is no tooltip-related method for the Shape class.I said "Set the tooltip text of the component."
itchyscratchya at 2007-7-9 5:36:28 > top of Java-index,Desktop,Core GUI APIs...
# 4
Still i m not getting please help me
Anand_Agrawala at 2007-7-9 5:36:28 > top of Java-index,Desktop,Core GUI APIs...
# 5
please help me
Anand_Agrawala at 2007-7-9 5:36:28 > top of Java-index,Desktop,Core GUI APIs...