void (Graphics g) { Insets insets = getInsets(); Graphics2D g2d = (Graphics2D)g.create(); double scale = JBUIScale.sysScale((Graphics2D)g); double devTop = insets.top * scale; // A workaround for IDEA-183253. If insets.top is *.5 in device space, then move up the image by one device pixel. if (devTop + 0.5 == Math.floor(devTop + 0.5)) { double devPix = 1 / scale; g2d.translate(0, -devPix); } try { if (transparentPopup) { g2d.setComposite(AlphaComposite.Src); } UIUtil.drawImage(g2d, myImage, insets.left, insets.top, null); } finally { g2d.dispose(); } }