void (Graphics g) { super.paintComponent(g); final int startX = myWrappedComponent.getWidth(); final int endX = getWidth(); if (endX > startX) { final FontMetrics fontMetrics = myWrappedComponent.getFontMetrics(myWrappedComponent.getFont()); final int y = fontMetrics.getMaxAscent(); final Color savedColor = g.getColor(); g.setColor(DASH_LINE_COLOR); drawDottedLine((Graphics2D)g, startX, y, endX, y); g.setColor(savedColor); } }