@Override
            public void stateChanged(ChangeEvent changeEvent) {
                if (ChannelPanel.tabNicks != null && !ChannelPanel.tabNicks.isEmpty()) ChannelPanel.tabNicks.clear();
                DnDTabbedPane pane = (DnDTabbedPane) changeEvent.getSource();
                int index = pane.getSelectedIndex();
                if (index == -1) return;
                ChannelPanel channel = (ChannelPanel) tabbedPane.getComponentAt(index);
                //if (!channel.connection.isConnected) pane.setForegroundAt(index, Color.gray);
                //else pane.setForegroundAt(index, Color.BLACK);
                if (index == 0) {
                    moveTabLeft.setForeground(Color.gray);
                    previousTab.setForeground(Color.gray);
                } else {
                    moveTabLeft.setForeground(Color.black);
                    previousTab.setForeground(Color.black);
                }
                if (index == tabbedPane.getTabCount() - 1) {
                    moveTabRight.setForeground(Color.gray);
                    nextTab.setForeground(Color.gray);
                } else {
                    moveTabRight.setForeground(Color.black);
                    nextTab.setForeground(Color.black);
                }
                channel.updateTabInfo();
            }