void (final Graphics g) { final Graphics2D g2 = (Graphics2D)g; final Dimension d = getSize(); final FontMetrics fm = g2.getFontMetrics(); if (myItems != null) { final boolean veryDirty = myCrumbs == null || myBuffer != null && !myBuffer.isValid(d.width); final List<Crumb> crumbList = veryDirty ? createCrumbList(fm, myItems, d.width) : myCrumbs; if (crumbList != null) { if (veryDirty) { //final BufferedImage bufferedImage = createBuffer(crumbList, d.height); myBuffer = new PagedImage(getTotalWidth(crumbList), d.width); myBuffer.setPage(myBuffer.getPageCount() - 1); // point to the last page } assert myBuffer != null; super.paint(g2); //if (myDirty) { // myBuffer.repaint(crumbList, getPainter()); //myDirty = false; //} myBuffer.paintPage(g2, crumbList, DEFAULT_PAINTER, d.height); myCrumbs = crumbList; } } else { super.paint(g2); } }