@Override
                public void actionPerformed(ActionEvent e) {
                    String choice = (String) combobox.getSelectedItem();
                    String chan = channelField.getText();


                    if (!chan.startsWith("#")) chan = "#" + chan;
                    if (choice == null) {
                        JOptionPane.showConfirmDialog(dialog, "Please choose a connection.", "No connection chosen", JOptionPane.WARNING_MESSAGE);
                        return;
                    }
                    ChannelPanel channel = null;
                    for (int i = 0; i < tabbedPane.getTabCount(); i++) {
                        channel = ((ChannelPanel) tabbedPane.getComponentAt(i));
                        if (channel.connection.title.equals(choice)) {
                            break;
                        }
                    }
                    try {
                        if (channel != null) {
                            channel.connection.send("JOIN " + chan);
                        }
                        dialog.dispose();
                    } catch (IOException | BadLocationException ex) {
                        Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
                    }

                }