void (Component c, Graphics g, int x, int y) { ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, AntialiasingType.getKeyForCurrentScope(false)); if (myHover) { g.setColor(myStyle.myHoverBackgroundColor); RectanglePainter2D.FILL.paint((Graphics2D)g, x, y, getIconWidth(), getIconHeight(), 6.0); } @NlsSafe String emoji = ITEM_EMOJI + myTone.getStringValue(); FontMetrics metrics = g.getFontMetrics(myStyle.myEmojiFont); int verticalOffset = metrics.getHeight() / 2 - metrics.getDescent(); int width = metrics.stringWidth(emoji); new TextLayout(emoji, myStyle.myEmojiFont, ((Graphics2D)g).getFontRenderContext()) .draw((Graphics2D)g, x + (getIconWidth() - width) / 2F, y + getIconHeight() / 2F + verticalOffset); }