Renderer Components

A single cell renderer Component contains many other Components...

...but a single cell renderer can stamp out a thousand parts.

public static class Left extends PartsRenderer {

    private JCheckBox isPostedCheck    = createCheckBox();
    private JLabel    lineNumberLabel  = createLabel(BOLD, CENTER);
    private JLabel    hasC2CLabel      = createLabel(CENTER);
    private JLabel    perCarQtyLabel   = createLabel(BOLD, CENTER);
    private JLabel    descriptionLabel = createLabel(BOLD);
    private JLabel[]  commentsLabels   = createCommentLabels(10);
    private JLabel    partNumberLabel  = createLabel(BOLD);
    private JLabel[]  conditionLabels  = createConditionLabels(6);

    protected void setValues(Object value) {

        Part part = (Part) value;

        isPostedCheck.setSelected(part.isPosted());
        lineNumberLabel.setText(String.valueOf(part.getLineNumber()) + '.');
        hasC2CLabel.setIcon((part.hasC2C()) ? c2cIcon : null);
        perCarQtyLabel.setText(part.getPerCarQty());
        descriptionLabel.setText(part.getDescription());