void (Graphics g) { if (update()) { setPreferredSize(myBounds.getSize()); setMinimumSize(myBounds.getSize()); revalidate(); repaint(); } g = g.create(); if (g instanceof Graphics2D) { UISettings.setupAntialiasing(g); } for (int i = 0; i < myScreenList.size(); i++) { ScreenInfo info = myScreenList.get(i); Rectangle bounds = info.myOuterBounds; int x = bounds.x - myBounds.x + getX(); int y = bounds.y - myBounds.y + getY(); g.setColor(JBColor.BLUE); g.fillRect(x, y, bounds.width, bounds.height); bounds = info.myInnerBounds; x = bounds.x - myBounds.x + getX(); y = bounds.y - myBounds.y + getY(); g.setColor(JBColor.BLACK); g.fillRect(x, y, bounds.width, bounds.height); String id = String.valueOf(i + 1); int size = Math.min(bounds.width << 1, bounds.height); g.setColor(JBColor.WHITE); g.setFont(new Font("Monospaced", Font.BOLD, size)); FontMetrics fm = g.getFontMetrics(); x += (bounds.width - fm.stringWidth(id)) / 2; y += (bounds.height - fm.getHeight()) / 2; g.drawString(id, x, y + size); } g.dispose(); }