private static void cleanUpChat(JTextPane box) throws BadLocationException {
        StyledDocument doc =  box.getStyledDocument();
        String[] lines = box.getStyledDocument().getText(0,  box.getStyledDocument().getLength()).split("\n");
        if (lines.length <= 100)
            return;
        String firstLine = lines[0];
        doc.remove(0, firstLine.length() + 1);
    }