@Override
                public void actionPerformed(ActionEvent e) {
                    int rowIndex = table.getSelectedRow();
                    if (rowIndex == -1) return;
                    SavedConnection conn = model.modelData.get(table.convertRowIndexToModel(rowIndex));

                    String network = conn.getNetwork(), server = conn.getServer();
                    int port = conn.retrievePort();
                    for (int i = 0; i < tabbedPane.getTabCount(); i++) {
                        ChannelPanel channel = (ChannelPanel) tabbedPane.getComponentAt(i);
                        if (network.equals(channel.title)) {
                            tabbedPane.setSelectedComponent(channel);
                            String[] msg = {null, "You are already connected to " + network + "."};
                            try {
                                channel.insertString(msg, errorStyle, false);
                            } catch (BadLocationException | IOException ex) {
                                Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
                            }
                            dialog.dispose();
                            return;
                        }
                    }
                    new Connection(network, server, port);
                    dialog.dispose();
                }