void (Graphics g, JComponent c) { FontMetrics metrics = g.getFontMetrics(g.getFont()); Dimension size = c.getSize(); g.setColor(c.getBackground()); g.fillRect(0, 0, size.width, size.height); g.setColor(c.getForeground()); int idx = 0; for (Iterator it = myLines.iterator(); it.hasNext(); idx++) { String line = (String)it.next(); g.drawString(line, 3, (metrics.getHeight()) * (idx + 1)); } }