public void addToUserList(String nick) throws BadLocationException, IOException {
        listSelectedIndex = userListPane.getSelectedIndex();
        String s2;
        nick = nick.trim();
        char first = nick.charAt(0);
        SortedListModel<User> model = (SortedListModel<User>) this.userListPane.getModel();

        if (first == '+' || first == '@' || first == '&' || first == '%' || first == '~') {
            if (first != '+') ops++;
            s2 = nick.substring(1);
            User u = new User(first + nick.substring(1));
            model.addElement(u);
        } else {
            s2 = nick;
            model.addElement(new User(" " + nick));
        }


        population = model.getSize();

        if (listSelectedIndex > -1 && listSelectedIndex < model.getSize()) {
            User u1 = userListPane.getModel().getElementAt(listSelectedIndex);
            String s1 = u1.getText();
            int result = ChannelPanel.compareNicks(s1, s2);
            if (result == 0) userListPane.clearSelection();
            if (result > 0) {
                listSelectedIndex++;
                userListPane.setSelectedIndex(listSelectedIndex);
            } else userListPane.setSelectedIndex(listSelectedIndex);

        }
        updateTabInfo();
    }