michaelwillian 28 de mar. de 2009
Problema resolvido!! eu tava tentando aqui e consegui...
foi assim que eu fiz... talvez alguém precise...
String [] d = null ;
try { d = dataNasc . getText (). split ( "/" ); } catch ( NumberFormatException ex ) { }
if ( Integer . parseInt ( d [ 1 ] ) >= 13 || Integer . parseInt ( d [ 0 ] ) >= 31
|| Integer . parseInt ( d [ 2 ] ) < 1900 || Integer . parseInt ( d [ 2 ] ) > 2000 )
JOptionPane . showMessageDialog ( null , "Data inválida" , "Aviso" , JOptionPane . WARNING_MESSAGE );
else {
String data = d [ 2 ] + "-" + d [ 1 ] + "-" + d [ 0 ] ;
obj = new SocketMngr (). connectToServer ( new Cliente ( null , nome . getText (),
sobrenome . getText (), cpf . getText (), data , endereco . getText (),
telefone . getText (), cidade . getText (), bairro . getText (), estadof . getText ()));
}
SENDO QUE dataNasc é um Formatted de data, com barras para separar os dias dos meses e dos anos ;)
abrass a todos!