Vector de Sockets conectados

Implementei os códigos abaixo e o objetivo deles era simplesmente mostrar em um JList no servidor todos os clientes autalmente conectados. Quando os clientes conectam, eles são adicionados normalmente, porém quando disconecto um cliente ele continua sendo exibido como se estivesse conectado. Tenho quase certeza que o erro está no método aceitarCliente() do Servidor.java. Quem tiver uma solução para o meu problema me mande, valeu!!!

//Este é o codigo do Servidor.java
import java.awt.;
import java.awt.event.
;
import javax.swing.;
import java.net.
;
import java.io.*;
import java.util.Vector;

public class Servidor extends JFrame implements ActionListener, Runnable {
private JMenuBar barra = new JMenuBar();
private JMenu menu = new JMenu(“Servidor”);
private JMenuItem mnu_ativar = new JMenuItem(“Ativar…”);
private JMenuItem mnu_desativar = new JMenuItem(“Desativar…”);
private JMenuItem mnu_sair = new JMenuItem(“Sair”);
private JList lst_clientes = new JList();
private JScrollPane slp_clientes = new JScrollPane( lst_clientes );
private JLabel lbl_clientes = new JLabel(“Clientes Conectados:”);
private JTextArea txa_info = new JTextArea();
private JLabel lbl_info = new JLabel(“Informações:”);
private JScrollPane slp_info = new JScrollPane( txa_info );
private ServerSocket servidor;
private Vector vcr_clientes = new Vector();
private Thread trd_aceita;

public Servidor() {
Container c = this.getContentPane();
c.setLayout( null );

lbl_clientes.setBounds( new Rectangle(30, 20, 150, 21) );
c.add(lbl_clientes);

slp_clientes.setBounds( new Rectangle(30, 40, 200, 300) );
c.add(slp_clientes);

lbl_info.setBounds( new Rectangle(250, 20, 150, 21) );
c.add(lbl_info);

slp_info.setBounds( new Rectangle(250, 40, 300, 300) );
c.add(slp_info);

menu.setMnemonic('S');
mnu_ativar.setMnemonic('A');
mnu_desativar.setMnemonic('D');
mnu_sair.setMnemonic('S');

mnu_ativar.addActionListener(this);
mnu_desativar.addActionListener(this);
mnu_sair.addActionListener(this);

menu.add(mnu_ativar);
menu.add(mnu_desativar);
menu.addSeparator();
menu.add(mnu_sair);
barra.add(menu);

this.setJMenuBar(barra);
this.setTitle("Servidor:> Desativado");
this.setSize(580, 410);
this.setResizable(false);
this.setDefaultCloseOperation(3);
this.show();

}

private void ativar(int p, int n) {
try{
this.setTitle(“Servidor:> Ativando…”);
servidor = new ServerSocket(p, n);
trd_aceita = new Thread(this);
trd_aceita.start();
this.setTitle(“Servidor:> Ativado.”);
}catch ( IOException e ){
JOptionPane.showMessageDialog(this, “Não foi possível ativar o servidor!”, e.toString(), JOptionPane.ERROR_MESSAGE);
}
}

private void desativar() {
try{
this.setTitle(“Servidor:> Desativando…”);
servidor.close();
trd_aceita.stop();
this.setTitle(“Servidor:> Desativado.”);
}catch( IOException e ) {
JOptionPane.showMessageDialog(this, “Não foi possível desativar o servidor!”, e.toString(), JOptionPane.ERROR_MESSAGE);
}
}

private void aceitarCliente() {
try{
if (vcr_clientes.size() > 0) {
for(int x=0; x<vcr_clientes.size(); x++) {
Socket c = (Socket) vcr_clientes.elementAt(x);
if ( !c.isConnected() ) {
vcr_clientes.removeElementAt(x);
lst_clientes.setListData( vcr_clientes );
}
}
}
vcr_clientes.add( servidor.accept() );
lst_clientes.setListData( vcr_clientes );
}catch ( IOException e ) {
JOptionPane.showMessageDialog(this, “O cliente não foi aceito!”, e.toString(), JOptionPane.ERROR_MESSAGE);
}
}

public void run() {
while (!servidor.isClosed()) {
aceitarCliente();
}
}

public void actionPerformed( ActionEvent e ) {
if (e.getSource() == mnu_ativar) {
ativar(5000, 100);
//aceitarCliente();
}
else if (e.getSource() == mnu_desativar)
desativar();
else if (e.getSource() == mnu_sair)
this.dispose();
}

public static void main(String args[]) {
Servidor app = new Servidor();
app.addWindowListener(
new WindowAdapter() {
public void windowClosing( WindowEvent e ){
System.exit(0);
}
}
);
}
}

//Este é o código do Cliente.java
import java.awt.;
import java.awt.event.
;
import javax.swing.;
import java.net.
;
import java.io.*;

public class Cliente extends JFrame implements ActionListener {
private JButton btn_conectar = new JButton(“Conectar…”);
private JButton btn_desconectar = new JButton(“Desconectar…”);
private Socket cliente;

public Cliente() {
Container c = getContentPane();
c.setLayout( null );

btn_conectar.setBounds(1, 30, 130, 21);
btn_conectar.addActionListener( this );
c.add( btn_conectar );

btn_desconectar.setBounds(150, 30, 130, 21);
btn_desconectar.addActionListener( this );
c.add( btn_desconectar );

this.setDefaultCloseOperation(3);
this.setTitle("Cliente:&gt; Desconectador");
this.setSize(300, 300);
this.show();

}

private void conectar(String ip, int p) {
try{
this.setTitle(“Cliente:> Conectando…”);
cliente = new Socket( InetAddress.getByName(ip), p );
this.setTitle(“Cliente:> Conectado”);
}catch( IOException e ) {
this.setTitle(“Cliente:> Desconectado”);
JOptionPane.showMessageDialog(this, “Não foi possível conectar no servidor!”, e.toString(), JOptionPane.ERROR_MESSAGE);
}
}

private void desconectar() {
try{
this.setTitle(“Cliente:> Desconectando…”);
cliente.close();
this.setTitle(“Cliente:> Desconectado…”);
}catch( IOException e ) {
JOptionPane.showMessageDialog(this, “Não foi possível desconectar do servidor!”, e.toString(), JOptionPane.ERROR_MESSAGE);
}
}

public void actionPerformed ( ActionEvent e ) {
if ( e.getSource() == btn_conectar )
conectar( “127.0.0.1”, 5000 );
else if ( e.getSource() == btn_desconectar )
desconectar();
}

public static void main(String args[]) {
final Cliente app = new Cliente();

app.addWindowListener(
  new WindowAdapter() {
    public void windowClosing( WindowEvent e) {
  app.desconectar();
  System.exit(0);
}
  }
);

}
}

Kra tenta dar uma atualizada no seu Vector , ai quando vc excluir o off line vc envia denovo para os usuarios q estao online os online
eu fiz assim e da certinho
Abraco
qualquer coisa
estou no meu email
fabiocaj@uol.com.br