I\'m trying to show multiple images in a component\'s tooltip, found createToolTip()
and implemented a custom that adds the needed components like this:
The base "problems" are that JToolTip
By-passing those limitations basically is a driving that widget nearly over the edge. A clean solution would roll a new component .. On the other hand, the OP already found the screws to tweak. The only thingy that could be slightly improved is to neither call setXXSize, nor set a custom ui. Instead, make it behave like a container by overriding getXXSize() like:
@Override
public Dimension getPreferredSize() {
if (getLayout() != null) {
return getLayout().preferredLayoutSize(this);
}
return super.getPreferredSize();
}