Tooltips in XYImageAnnotations
Tooltips in XYImageAnnotations
Is there a way to show tooltips (small box with text) when you hover the mouse over the image? Or maybe making the image clickable, then opening a small window when user clicks it...? Is it possible?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The XYImageAnnotation class inherits a setToolTipText() method from AbstractXYAnnotation.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


JFreeChart uses the standard Swing tooltip support. Tooltips (like every other Swing text component) can render a subset of html. This will do what you want:
Code: Select all
setToolTipText("<html><body>line1<br>line2</body></html>");