float (Graphics g) { if (myLineHeight >= 0) { return myLineHeight; } FontRenderContext fontRenderContext = ((Graphics2D) g).getFontRenderContext(); LineMetrics lineMetrics = myPlainFont.getLineMetrics(DEFAULT_MEASURE_HEIGHT_TEXT, fontRenderContext); myLineHeight = lineMetrics.getHeight(); return myLineHeight; }