public void draw(Graphics2D g2, float x, float y) { startDraw(g2, x, y); float xPos = x; for (Box box : children) { box.draw(g2, xPos, y + box.shift); xPos += box.getWidth(); } endDraw(g2); }