This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
While a scene has a zoom factor different from 1.0, then the font boundaries does not fit becuase of following condition: zoomfactor * graphics.getFontMetric (new Font (fontHeight)).getWidth (label) != graphics.getFontMetric (new Font (fontHeight * zoomfactor)).getWidth (label) Temporary workaround is to call Widget.setCheckClipping (true); It will remove the repaint problem, but the text may be cut.
*** Issue 85696 has been marked as a duplicate of this issue. ***
One way to make sure it always fits is to take as initial width : rectangle.width = fontMetrics.charWidth('W') * label.length(); I know it is ugly but it works (even with strings that only contains spaces).
Setting as duplicate since it have the same reason and will be resolved the same way. *** This issue has been marked as a duplicate of 98762 ***