@Override public void repaint(Graphics graphics) { if (show) { final FontMetrics fm = graphics.getFontMetrics(); graphics.setFont(calibri); for (GroundItem groundItem : ctx.groundItems.select().select(displayFilter)) { graphics.setColor(Color.BLACK); final Point center = groundItem.centerPoint(); final String displayString = groundItem.name() + " x" + groundItem.stackSize() + " - $" + format.format((priceMap.get(groundItem.id()) * groundItem.stackSize())); final int width = fm.stringWidth(displayString); final int height = fm.getHeight(); graphics.fillRoundRect( center.x - (width / 2), center.y + (height / 2), width + 4, height + 5, 10, 10); graphics.setColor(Color.WHITE); graphics.drawString( displayString, center.x - (width / 2) + 2, center.y + (height / 2) + height); } } }