CalculatedStyle style = c.css.getStyle(block.getRealElement());
CalculatedStyle style = null; if (box.getContent() == null) { XRLog.render(Level.WARNING, "null content in BoxRenderer.paintBackground for " + box.getClass().getName());  } else { style = box.getContent().getStyle(); }
    public void paintBackground(Context c, Box box) {        Box block = box;        // cache the background color        getBackgroundColor(c, block);        // get the css properties        CalculatedStyle style = c.css.getStyle(block.getRealElement());        String back_image = style.getStringProperty("background-image");        block.repeat = style.getStringProperty("background-repeat");        block.attachment = style.getStringProperty("background-attachment");        // handle image positioning issues        // need to update this to support vert and horz, not just vert        if (style.hasProperty("background-position")) {            Point pt = style.getBackgroundPosition();            block.background_position_horizontal = (int) pt.getX();            block.background_position_vertical = (int) pt.getY();        }        // load the background image        block.background_image = null;        if (back_image != null && !"none".equals(back_image)) {            try {                block.background_image = ImageUtil.loadImage(c, back_image);            } catch (Exception ex) {                ex.printStackTrace();                u.p(ex);            }            /*             * ImageIcon icon = new ImageIcon(back_image);             * if(icon.getImageLoadStatus() == MediaTracker.COMPLETE) {             * block.background_image = icon.getImage();             * }             */        }        // actually paint the background        BackgroundPainter.paint(c, block);    }