void (Graphics2D g, int x, int y, String s, double scale) { g.setFont(JBUI.Fonts.label().biggerOn(20)); Rectangle2D bounds = g.getFontMetrics().getStringBounds(s, g); g.setColor(Color.WHITE); float xx = (float)(getIconWidth() - bounds.getWidth()) / 2; float yy = (float)(getIconHeight() - bounds.getHeight()); for (int dx = -1; dx<=1; dx++) { for (int dy = -1; dy<=1; dy++) { g.drawString(s, x + (float)scale * xx + dx, y + (float)scale * yy + dy); } } g.setColor(Color.BLACK); g.drawString(s, x + (float)scale * xx, y + (float)scale * yy); }