I am trying to write an IRC client for fun and practice. One thing I'm struggling with is adding lines received from the server to my display. I basically have a class called chatline which has a timestamp, a prefix and a message, all represented by a JLabel. When such a line is added to the display, I just add each of these JLabels to the parent JPanel and wrap after the last one. But, for some reason, no line is to be seen.

The "Screen" class, which contains the ScrollPane and JPanel
Java Code:
package de.boreeas.aurora.gui;

import java.util.ArrayList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import net.miginfocom.swing.MigLayout;

/**
 *
 * @author malte
 */
public class Screen {
    
    public final String name;
    public final JScrollPane scrollPane;
    public final JPanel panel;
    
    private final MigLayout layout;
    
    private final ArrayList<ChatLine> savedLines = new ArrayList<ChatLine>(100);
    
    
    public Screen(final String name) {
        
        this.name = name;
        scrollPane = new JScrollPane();
        layout = new MigLayout();
        panel = new JPanel(layout);
        scrollPane.add(panel);
        
        panel.setLayout(layout);
    }
    
    public void addLine(ChatLine line) {
        
        if (savedLines.size() == 100) {
            
            savedLines.remove(0);
        }
        
        savedLines.add(line);
        rebuild();
    }
    
    
    public void addLine(String hexcolor, String prefix, String message) {
        
        addLine(new ChatLine(prefix, message).withAllColors(hexcolor));
    }
    
    public void addError(String message) {
        
        addLine(ChatLine.createErrorMessage(message));
    }
    
    private void rebuild() {
        
        for (ChatLine line: savedLines) {
            
            line.append(panel);
        }
    }
}
and the ChatLine class:
Java Code:
package de.boreeas.aurora.gui;

import java.awt.Color;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author malte
 */
public class ChatLine {
    
    private final JLabel timeStampLabel;
    private final JLabel prefixLabel;
    private final JLabel messageLabel;
    
    public ChatLine(String name, String prefix) {
        
        this.timeStampLabel = new JLabel(new SimpleDateFormat("hh:mm").format(new Date()));
        this.prefixLabel = new JLabel(name);
        this.messageLabel = new JLabel(prefix);
        
    }
    
    public ChatLine withTimeStampColor(String hexcolor) {
        
        timeStampLabel.setBackground(Color.decode(hexcolor));
        return this;
    }
    
    public ChatLine withPrefixColor(String hexcolor) {
        
        prefixLabel.setBackground(Color.decode(hexcolor));
        return this;
    }
    
    public ChatLine withMessageColor(String hexcolor) {
        
        messageLabel.setBackground(Color.decode(hexcolor));
        return this;
    }
    
    public ChatLine withAllColors(String hexcolor) {
        
        timeStampLabel.setBackground(Color.decode(hexcolor));
        prefixLabel.setBackground(Color.decode(hexcolor));
        messageLabel.setBackground(Color.decode(hexcolor));
        
        return this;
    }
    
    public void append(JPanel panel) {
        
        panel.add(timeStampLabel);
        panel.add(prefixLabel);
        panel.add(messageLabel, "wrap");
    }
    
    /**
     * Creates a ChatLine with prefix [ERROR] and color #990000
     * @param message The error message
     * @return A new ChatLine object with prefix [ERROR] and color #990000
     */
    public static ChatLine createErrorMessage(String message) {
        
        // TODO remove debug output
        System.out.println("Creating error message chat line: [ERROR] " + message);
        return new ChatLine("[ERROR]", message).withAllColors("#990000");
    }
    
}
A SSCCE can be found here:
http://dl.dropbox.com/u/31575034/AuroraSSCCE.zip