I display thumbnails in a JPanel. When hovering over such a thumbnail, I want to display its full version in an overlay over the thumbnail.
Using HTML I would just create a div with the proper positions and a high z-index, so that it overlays everything else. Is something similiar and lightweight possible with Swing?
One way is to use a tool-tip.
Note:
I did not bother to 'thumbnail' the original images. 'Batteries not included'.The latest edit of the source use HTML (thewidth
/height
specified for theimage
) to shrink the 'thumbnails'. I won't update the screenshot.JWindow
is better, since it gives you more control of where and for how long the pop-up appears, as well as its exact look. But this hack is significantly shorter. ;)