if (tabbedPane.getTitleAt(i).equalsIgnoreCase(name)) {
if (tabbedPane.getTitleAt(i).equalsIgnoreCase(user.getName())) {
    private void makePanel() {        setLayout(new BorderLayout());        textArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));        textArea.setEditable(false);        textArea.setBackground(Color.WHITE);        textField = new JTextField();        Set set = new HashSet(1);        set.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_JAPANESE_HIRAGANA, 0));        textField.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);        textField.addActionListener(this);        textArea.addKeyListener(new KeyAdapter(){            public void keyTyped(KeyEvent ke){                textField.setText(textField.getText() + ke.getKeyChar());                textField.requestFocus();            }        });        textField.addKeyListener(new KeyAdapter(){            public void keyReleased(KeyEvent ke){                super.keyReleased(ke);                if (ke.getKeyCode() == KeyEvent.VK_TAB) {                    String text = textField.getText();                    if (text.length()>0){                        int index = text.lastIndexOf(' ');                        int index2 = text.lastIndexOf(',');                        if (index2>index){                            index = index2;                        }                        String searchString;                        if (index != -1){                            searchString = text.substring(index+1).toLowerCase();                        }                        else{                            searchString = text.toLowerCase();                        }                        String treffer = "";                        int count = 0;                        synchronized (usernameList) {                            User[] users = usernameList.getValues();                            String compareValue;                            for (int i=0; i<users.length; i++){                                if (users[i].getName().startsWith(searchString)){                                    treffer += users[i].getName() + " ";                                    count ++;                                }                            }                        }                        if (treffer.length()>0){                            treffer = treffer.substring(0,                                treffer.length() - 1);                            if (count == 1) {                                if (index != -1) {                                    String newText = text.subSequence(0,                                        index + 1) + treffer;                                    textField.setText(newText);                                }                                else {                                    textField.setText(treffer);                                }                            }                            else if (count > 1) {                                updateTextArea("\t" + treffer, false);                            }                        }                    }                }                else if (befehlPos != -1){                    if (ke.getKeyCode() == KeyEvent.VK_UP) {                        textField.setText((String)befehle.get(befehlPos));                        if (befehlPos>0){                            befehlPos--;                        }                    }                    else if (ke.getKeyCode() == KeyEvent.VK_DOWN) {                        if (befehlPos<befehle.size()-1){                            befehlPos++;                        }                        textField.setText( (String) befehle.get(                            befehlPos));                    }                }            }        });        userList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);        userList.addMouseListener(new MouseAdapter(){            public void mouseClicked(MouseEvent me){                if (me.getClickCount()==2){                    User user = (User)userList.getSelectedValue();                    if (!user.getName().equalsIgnoreCase(parentPanel.getNickname())){                        JTabbedPane tabbedPane = parentPanel.getTabbedPane();                        for (int i = 1; i < tabbedPane.getTabCount(); i++) {                            if (tabbedPane.getTitleAt(i).equalsIgnoreCase(name)) {                                return;                            }                        }                        parentPanel.addUser(tabbedPane, name);                        tabbedPane.setSelectedIndex(tabbedPane.getTabCount() -                            1);                    }                }            }        });        userList.setCellRenderer(new UserListCellRenderer());        JScrollPane sp1 = new JScrollPane(textArea);        JScrollPane sp2 = new JScrollPane(userList);        JPanel panel1 = new JPanel(new BorderLayout());        panel1.add(counter, BorderLayout.NORTH);        panel1.add(sp2, BorderLayout.CENTER);        sp1.setVerticalScrollBarPolicy(JScrollPane.                                       VERTICAL_SCROLLBAR_ALWAYS);        sp1.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {            public void adjustmentValueChanged(AdjustmentEvent e) {            }        });        sp2.setVerticalScrollBarPolicy(JScrollPane.                                       VERTICAL_SCROLLBAR_ALWAYS);        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,                                              sp1,                                              panel1);        splitPane.setDividerLocation(AppleJuiceDialog.getApp().getSize().width - 200);        add(splitPane, BorderLayout.CENTER);        add(textField, BorderLayout.SOUTH);        add(makeNorth(), BorderLayout.NORTH);    }