I'm using JFreeChart where I customized the chart's tooltip by implementing the XYToolTipGenerator
interface.
As the generateToolTip()
method is supposed to return a String, here is what I did to show images in the tooltip:
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
(...)
return "<html><body><img src=\"file:resources/img/image.png\"></body></html>";
}
While this works perfectly when executing directly from my IDE (Eclipse), it obviously fails when being executed from a packaged JAR file (the image.png is also in the JAR file).
Any hint on how to solve this would be greatly appreciated (ideally without having to extract the image.png from the JAR file).
Many thanks, Thomas
getResource()
works, so it is definitely related to the tooltip. – Tom Apr 22 '13 at 20:23