I have a JComponent that\'s painting various shapes on itself. I\'m detecting whenever the mouse enters one of these shapes and changing the tooltip accordingly.
To solve your first issue of where the tooltip doesn't follow the mouse, if you override the getToolTipLocation(MouseEvent e) in JComponent, you can return the point for where you want to the display the tooltip. The MouseEvent will allow you to retrieve the x and y.