If you want the tooltip to be above your widget, the line could just be
return new Point(0, -20);
Told you it was simple :-). If you wanted to be fancy, you could calculate the
negative value based on the height of the Tooltip font.
tom
> On Jan 29, 2018, at 8:18 PM, José J. Rodriguez
Thomas Wolf wrote:
Turns out overriding getTooltipLocation() is really easy - my main
concern was that if I overrode that method with a fixed location, I'd
lose Swing's fancy calculations that prevent the tooltip from being cut
off by the edge of the screen. Turns out that was unfounded - it s
Turns out overriding getTooltipLocation() is really easy - my main concern
was that if I overrode that method with a fixed location, I'd lose Swing's
fancy calculations that prevent the tooltip from being cut off by the edge
of the screen. Turns out that was unfounded - it still does that. So my
I just came across a curious problem that I can't believe has not been
addressed in the decades that Swing has now been around (and I've been
using it :-( It has to do with Tooltips:
Suppose you have a widget - e.g. a JButton - in the bottom right of your
window. This widget displays some usefu