-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0
-
beta
-
generic
-
generic
Name: dbT83986 Date: 03/30/99
set a border on a JToolTip that has a width/height greater than
1. as in:
public JToolTip createToolTip()
{
JToolTip tt = new JToolTip();
tt.setComponent(this);
tt.setBorder(new LineBorder(Color.black, 5));
return tt;
}
when the JToolTip is displayed on the screen, some of the
text will be overwritten by the border.
BasicToolTipUI has in its getPreferredSize() :
Font font = c.getFont();
FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(font);
// fix for bug 4094153
String tipText = ((JToolTip)c).getTipText();
if (tipText == null)
return new Dimension(6,metrics.getHeight() + 4);
else
return new Dimension(metrics.stringWidth(tipText) + 6,
metrics.getHeight() + 4);
look at all those "magic" numbers. it really should call
getInsets().
(Review ID: 56301)
======================================================================