12/09/11

Digitalização do sinal Analogico


digitalizar um sinal analógico 
A digitalização do sinal de video passas por 4 etapas que sao:


1)- Filtragem anti-aliasing.
2)- Amostragem
3)- Quantização
4)- Codificação destes valores em bits. 

Na  pratica, a amostragem, a quantificação e a codificaçãopodem ser feitas por um único circuito eletrônico, e não necessariamente nesta ordem, ou até simultaneamente.




Filtragem anti-aliasing: Antes do processo de amostragem um filtro anti-aliasing passa baixas é usado para atenuar as componentes de alta freqüência do sinal que não são essenciais para a informação contida nele. Logo o sinal filtrado é amostrado a uma taxa ligeiramente mais elevada do que de Nyquist,  já que de acordo com o Teorema de Nyquist, a quantidade de amostras por unidade de tempo de um sinal, chamada taxa ou frequência de amostragem, deve ser maior que o dobro da maior frequência contida no sinal a ser amostrado, para que possa ser reproduzido integralmente sem erro de aliasing.

Amostragem : É a divisão do sinal no eixo do tempo em amostras analógicas discretas PAM (Modulação em Amplitude de Pulso).

Quantização : divisão do sinal PAM no eixo de tensão em valores discretos finitos 

Codificação: Os valores quantizados precisam ser codificados em seqüências de bits, pois um sinal digital binário só pode ter dois valores diferentes "0" ou "1". Em binário puro, a codificação seria como mostra a figura acima, que é um exemplo de um sinal digital  PCM (Pulse Code Modulation), onde cada pulso PAM de amplitude variável é transformado em uma seqüência de bits com amplitude fixa e valores 0 ou 1, com um código tal que representa o valor do pulso PAM original, arredondado pelo erro de quantização.
 
 

Decibel


 O que o é o decibel?

Decibel é apenas uma forma de expressar razões, especialmente as razões de potência. Se tomarmos o ganho de um estágio amplificador, os padrões de irradiação de uma antena ou a perda em uma linha de transmissão, geralmente estamos interessados na razão entre a potência de entrada e a potência de saída do sistema em questão, a razão de potência entre o sinal captado pela parte frontal e parte traseira de uma antena direcional, etc. Estes são alguns exemplos dos campos onde o decibel é aplicado e portanto onde encontramos resultados em dB.

Decibel é uma função logarítmica. Logaritmo é uma útil ferramenta matemática baseada em expoentes. Uma característica importante do logaritmo é sua multiplicação, que pode ser realizada com a adição de quantidades logarítmicas. Do mesmo modo as divisões são realizadas subtraindo-se quantidades logarítmicas. Tal método é benéfico ao se lidar com múltiplos estágios de amplificação ou atenuação, quando um minúsculo sinal do éter é amplificando e processando de tal forma que possamos ouví-lo num alto falante. Ao invés de multiplicar e dividir os valores em cada estágio – frequentemente com sinais extremamente fracos e com vários zeros após o ponto decimal – nós podemos considerar todos os valores em dB e obter o ganho total de um sistema de uma maneira simplificada.

A entrada e/ou a saída pode ser caracterizada por um determinado nível de sinal, que pode ser medido em Volt, Ampere ouWatt.

Se o nível à saída for superior ao nível à entrada diz-se que o sistema apresenta ganho. Caso contrário, diz-se que o sistema tem ou causa atenuação

Calculos de potencia
Na medição de potência o bel é calculado assim:

P(Bel) = log10 (P/P0)
onde:   P = potência medida
P0 = potência de referência

Conforme foi referido, o sistema apresenta ganho (G) se P2 > P1 e atenuação (A) caso contrário.

G(dB) = 10 * log10 (P2/P1)
A(dB) =10* log10 (P1/P2)





Tanto o ganho (G) como a atenuação (A) calculam-se da mesma forma e existe uma relação entre eles.

Ganho = -Atenuação

Sistema
 
2mw                                           4mw
                                                                             


                                                   

        Visto que a saída é o dobro da entrada o sistema tem ganho igual a:
                         10*log ( 4mW/2mW) = 10*log (2) = +3,01dB ≈ +3dB

       Se a saída é o dobro da entrada, então o ganho é de +3dB (100%)
       Se a saída é metade da entrada (50%), então o ganho é de - 3dB, ou seja, há uma atenuação de +3dB!

O decibel (dB) na medida de tensão
O decibel utilizado na medida de tensão é muito parecido com o decibel utilizado na medida de potência:

Av(dB) = 20 log10 (E/E0)

O multiplicador passa a ser “20” no lugar de “10” considerando os seguintes fatos:
·         P = E2 x R
Lembrando da propriedade dos logaritmos que diz que log (x2) = 2 log(x), teremos:
·         dB = 20 log ( V1 / V2 ) + 10 log ( R2 / R1)
Se considerarmos o mesmo valor da resistência:
·         dB = 20 log (V1 / V2)


10/09/11

Carrinho do netinho feito em Lingugem C

O Carrinho do netinho que funciona atravez da porta paralela do pc feito em lingugem c 

 

para quem tiver necessitando fazer a conexao de um despositivo externo pela porta paralela tambem pode dar uma vista no codigo na esquecer de baixar UserPort para habiliatar a porta Paralela do teu PC.


#include
#include
#include

typedef void _stdcall (*PtrOut)(short EndPorta, short valor); //Declara��o dos ponteiros para fun��o

//sinais a enviar para a porta paralela
#define FRENTE 1
#define FRENTE_DIRETA 2
#define FRENTE_ESQUERDA 3
#define RETAGUARDA 4
#define RETAGUARDA_ESQUERDA 5
#define RETAGUARDA_DIREITA 6
#define TURBO 7
#define MUITOLENTO 8
#define PARADO 0

//tamanho do vector
#define TAM 9
#define INIC -1

//nome do ficheiro
#define NOMEFICH "C:\\Modesto.txt"

//endere�o da porta
#define PORTA


//prototipo das funcoes
void Menuprincipal(int *v);
void Automatico(int *v,int flag);
int Manual(int *v);
void inic_vect(int *v,int j);
void addcomando(int *v,int i,int j);
void inverte_vect(int *v,int j);
void insere_opostos(int *v);
void grava_dados(int *v);
int selec(int *v,int *x);
void exec_accao(int *v);
void imprime(int*v);
void exec_accao_fich();
void le_fich(int *v);
void envia_sinal(int sinal);

void Menuprincipal(int *v)
{
int opcao;
int flag;
do
{
printf("\n\n\n");
printf("\tMenu de Controlo do Veiculo\n\n");
printf("\t\tModo Manual--------1\n");
printf("\t\tModo Automatico----2\n");
printf("\t\tFinalizar----------0\n");
printf("\n\n\tEscolha uma opcao:");
scanf("%d",&opcao);

switch(opcao)
{
case 0:{printf("Fim do programa!!!\n");
exit(0);
}
case 1:flag=Manual(v);break;
case 2:Automatico(v,flag);break;
}

}while(opcao!=0);
}

void Automatico(int *v,int flag)
{
int opcao;
printf("\n\n\n");
printf("\t\tModo Automatico\n");
printf("\t\tApartir de um Vector----1\n");
printf("\t\tApartir de um Ficheiro----2\n");
printf("\t\tVoltar----0\n");
printf("\n\n\tEscolha uma opcao:");
scanf("%d",&opcao);

switch(opcao)
{
case 0:
{
Menuprincipal(v);break;
}
case 1:
{
printf("\n\n\n\nLendo dados do Vector\n\n");
if(flag==0)
{
printf("\n\nERRO:Comandos Inexistentes\n\n");
return;
}
else
{
inverte_vect(v,TAM-1);
insere_opostos(v);
exec_accao(v);
break;
}
}
case 2:
{
printf("\n\nLendo dados do Ficheiro\n\n");
exec_accao_fich();
break;
}
}

}

int Manual(int *v)
{

int opcao;
int flag;
flag=0;
inic_vect(v,INIC);

do
{
printf("\n\n\n");
printf("\t\tModo Manual\n\n");
printf("\t\tFrente------------------8\n");
printf("\t\tRetaguarda--------------2\n");
printf("\t\tFrente_Direita----------9\n");
printf("\t\tFrente_Esquerda---------7\n");
printf("\t\tRetaguarda_Direita------3\n");
printf("\t\tRetaguarda_Esquerda-----1\n");
printf("\t\tTurbo-------------------5\n");
printf("\t\tMuito_Lento-------------6\n");
printf("\t\tParado------------------4\n");
printf("\t\tVoltar------------------0\n");
printf("\n\n\tEscolha uma opcao:");
scanf("%d",&opcao);

switch(opcao)
{

case 0:
{
if(flag==0)
{
printf("\n\nAVISO:Nao foram introduzidos comandos\n\n");break;
}
else
{
grava_dados(v);
Menuprincipal(v);break;
}

}
case 1:
{
flag=1;
v[0]=RETAGUARDA_ESQUERDA;
envia_sinal(RETAGUARDA_ESQUERDA);
printf("\n\nMovendo-se para Retaguarda_Esquerda\n\n");break;
}
case 2:
{
flag=1;
v[1]=RETAGUARDA;
envia_sinal(RETAGUARDA);
printf("\n\nMovendo-se para Retaguarda\n\n");break;
}
case 3:
{
flag=1;
v[2]=RETAGUARDA_DIREITA;
envia_sinal(RETAGUARDA_DIREITA);
printf("\n\nMovendo-se para Retaguarda_Direita\n\n");break;
}
case 4:
{
flag=1;
v[3]=PARADO;
envia_sinal(PARADO);
printf("\nParado\n\n");break;
}
case 5:
{
flag=1;
v[4]=TURBO;
envia_sinal(TURBO);
printf("\n\nVelocidade Turbo\n\n");break;
}
case 6:
{
flag=1;
v[5]=MUITOLENTO;
envia_sinal(MUITOLENTO);
printf("Movimentando-se Muito_Lento\n");break;
}
case 7:
{
flag=1;
v[6]=FRENTE_ESQUERDA;
envia_sinal(FRENTE_ESQUERDA);
printf("\n\nMovendo-se para Frente_Esquerda\n\n");break;
}
case 8:
{
flag=1;
v[7]=FRENTE;
envia_sinal(FRENTE);
printf("\n\nMovendo-se para Frente\n\n");break;
}
case 9:
{
flag=1;
v[8]=FRENTE_DIRETA;
envia_sinal(FRENTE_DIRETA);
printf("\n\nMovendo-se para Frente_Direita\n\n");break;
}

}

}while(opcao!=0);
return flag;
}

void inic_vect(int *v,int j)
{
int i;
for(i=0;i
Java com banco de dados Por Herlander Falo
hoje poderei ajudar-te amigo na criação de uma aplicação com banco de dados tudo em standard
 Primeiramente vamos criar o banco de dado Exemplo

Nome do banco de dados : Exemplo, user : root, senha: root

o banco de dados Cliente deve ter uma tabela Clientes 


a tabela cliente devera ter :(Cod_Cli :integer ,  Nome :varchar, Bairro :varchar, cep,  Cidade :varchar, cpf :integer, DataNasc :varchar, EstadoCivil :varchar, sexo :varchar,  Rua :varchar, telefone :int, Celular :integer, Email :varchar,  Categoria: varchar,).

criar um pacote Controlo onde podera constar a conexao, isto criar uma pasta e colar o seguinte codigo em ConnectionFactory.java



package Controlo;
import java.sql.*;

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Herlander
*/
public class ConnectionFactory {
public static Connection getConnection() throws SQLException
{
try {
Class.forName("com.mysql.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://localhost/supermercado","root","Modesto");

}
catch (ClassNotFoundException e)
{
throw new SQLException(e.getMessage());
}
}

}


Agora criar outro pacote com nome modelo e dentro dele a classe Cliente.java

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Modelo;

import java.sql.Date;

/**
 *
 * @author Herlander
 */
public class Clientes {
    private String nome,rua,bairro,cidade,estadocivil,genero,email,categoria;
    private int codigo,cpf,cep,TelefCelular,TelefResidencial;
    private String dataNasc;

    public Clientes() {
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCategoria() {
        return categoria;
    }

    public void setCategoria(String categoria) {
        this.categoria = categoria;
    }



    public int getCodigo() {
        return codigo;
    }

    public void setCodigo(int codigo) {
        this.codigo = codigo;
    }

  


    public int getTelefCelular() {
        return TelefCelular;
    }

    public void setTelefCelular(int TelefCelular) {
        this.TelefCelular = TelefCelular;
    }

    public int getTelefResidencial() {
        return TelefResidencial;
    }

    public void setTelefResidencial(int TelefResidencial) {
        this.TelefResidencial = TelefResidencial;
    }

    public String getBairro() {
        return bairro;
    }

    public void setBairro(String bairro) {
        this.bairro = bairro;
    }

    public int getCep() {
        return cep;
    }

    public void setCep(int cep) {
        this.cep = cep;
    }

    public String getCidade() {
        return cidade;
    }

    public void setCidade(String cidade) {
        this.cidade = cidade;
    }

    public int getCpf() {
        return cpf;
    }

    public void setCpf(int cpf) {
        this.cpf = cpf;
    }

    public String getDataNasc() {
        return dataNasc;
    }

    public void setDataNasc(String dataNasc) {
        this.dataNasc = dataNasc;
    }

   

    public String getEstadocivil() {
        return estadocivil;
    }

    public void setEstadocivil(String estadocivil) {
        this.estadocivil = estadocivil;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getRua() {
        return rua;
    }

    public void setRua(String rua) {
        this.rua = rua;
    }

    public String getGenero() {
        return genero;
    }

    public void setGenero(String genero) {
        this.genero = genero;
    }
   
}
 


criar o pacote dao e dentro dele a classe ClienteDao.java

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Dao;
import Modelo.*;
import Dao.*;
import Controlo.*;
import java.sql.*;
import java.util.Vector;
import javax.swing.JOptionPane;



/**
 *
 * @author Herlander
 */
public class ClienteDao
{
    private Connection connection;
    ResultSet rs;
    Statement stmt;
    PreparedStatement st;
  

    public ClienteDao() throws SQLException
        {
            this.connection = ConnectionFactory.getConnection();
        }
     
    public void Inclusao(Clientes clientes) throws SQLException
    {
        String sql= "insert into Clientes (Nome,DataNasc,Sexo,cpf,EstadoCivil,cep,Cidade,Bairro,Categoria,Telefone,Celular,Email,Rua) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)";
      st = this.connection.prepareStatement(sql);

      //  st = this.connection.prepareStatement("insert into clientes (Nome,DataNasc,Sexo,cpf,EstadoCivil,cep,Cidade,Bairro,Categoria,Telefone,Celular,Email,Rua)"+
//"VALUES ('Herlander','1974-04-04','Masculino',1,'Solteiro',1,'Bengo','Terra nova','Estudante',00000000,00000000,'modesto','beiras ');");
         // seta os valores
            clientes.setNome(" nome ");
            clientes.setBairro(" bairro");
            clientes.setCep(1);
            clientes.setCidade(" cidade");
            clientes.setCpf(1);
            clientes.setDataNasc("1980-04-02");
            clientes.setEstadocivil("estadoCivil");          
            clientes.setRua("insira a rua");
            clientes.setTelefResidencial(1);
            clientes.setTelefCelular(1);
            clientes.setEmail("insira o email");
            clientes.setCategoria("insira a categoria");
          
           
            st.setString(1,clientes.getNome());
            st.setString(2, clientes.getDataNasc());
            st.setString(3, clientes.getGenero());
            st.setInt(4, clientes.getCpf());
            st.setString(5, clientes.getEstadocivil());
            st.setInt(6, clientes.getCep());
            st.setString(7, clientes.getCidade());
            st.setString(8,clientes.getBairro() );
            st.setString(9, clientes.getCategoria());
            st.setInt(10,clientes.getTelefResidencial());
            st.setInt(11, clientes.getTelefCelular());
            st.setString(12, clientes.getEmail());
            st.setString(13, clientes.getRua());

           
            // executa
            st.execute();
//Nome,DataNasc,Sexo,cpf,EstadoCivil,cep,Cidade" +
    //            "Bairro,Categoria,Telefone,Celular,Email)           
            moveFirst(clientes);
            moveUltimo(clientes);
            clientes.setNome(rs.getString("Nome"));
            clientes.setBairro("Bairro");
            clientes.setCep((rs.getInt("cep")));
            clientes.setCidade(rs.getString("Cidade"));
            clientes.setCpf(rs.getInt("cpf"));
            clientes.setDataNasc(rs.getString("DataNasc"));
            clientes.setEstadocivil(rs.getString("EstadoCivil"));
            clientes.setGenero(rs.getString("sexo"));
            clientes.setRua(rs.getString("Rua"));
            clientes.setTelefResidencial(rs.getInt("telefone"));
            clientes.setTelefCelular(rs.getInt("Celular"));           
            clientes.setEmail(rs.getString("Email"));
            clientes.setCategoria(rs.getString("Categoria"));
            clientes.setCodigo(rs.getInt("Cod_Cli"));
             st.close();
           
           
            //setar valores ao codigo
           
           
           
           
                            
    }
    public void adicionar(Clientes clientes) throws SQLException
    {
        //stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
          st = this.connection.prepareStatement("UPDATE clientes Set Nome=?,DataNasc=?,Sexo=?,cpf=?,EstadoCivil=?,cep=?,Cidade=?,Bairro=?,Categoria=?,Telefone=?,Celular=?,Email=?,Rua=? WHERE Cod_Cli=?");
            st.setString(1,clientes.getNome());
            st.setString(2, clientes.getDataNasc());
            st.setString(3, clientes.getGenero());
            st.setInt(4, clientes.getCpf());
            st.setString(5, clientes.getEstadocivil());
            st.setInt(6, clientes.getCep());
            st.setString(7, clientes.getCidade());
            st.setString(8,clientes.getBairro() );
            st.setString(9, clientes.getCategoria());
            st.setInt(10,clientes.getTelefResidencial());
            st.setInt(11, clientes.getTelefCelular());
            st.setString(12, clientes.getEmail());
            st.setString(13, clientes.getRua());
            st.setInt(14, clientes.getCodigo());
            // executa
            st.execute();
         
          clientes.setNome(rs.getString("Nome"));
            clientes.setBairro("Bairro");
            clientes.setCep((rs.getInt("cep")));
            clientes.setCidade(rs.getString("Cidade"));
            clientes.setCpf(rs.getInt("cpf"));
            clientes.setDataNasc(rs.getString("DataNasc"));
            clientes.setEstadocivil(rs.getString("EstadoCivil"));
            clientes.setGenero(rs.getString("sexo"));
            clientes.setRua(rs.getString("Rua"));
            clientes.setTelefResidencial(rs.getInt("telefone"));
            clientes.setTelefCelular(rs.getInt("Celular"));
            clientes.setEmail(rs.getString("Email"));
            clientes.setCategoria(rs.getString("Categoria"));
            clientes.setCodigo(rs.getInt("Cod_Cli"));
            st.close();

         
        
   
    }

    public void Delete(Clientes clientes) throws SQLException
         {
       
    st = connection.prepareStatement("DELETE FROM clientes WHERE Cod_Cli=?");
    st.setInt(1, clientes.getCodigo());
    st.execute();
    rs.updateRow();
    st.close();
   
        }
    public void moveFirst(Clientes clientes) throws SQLException
    {
        try{
        stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
        rs = stmt.executeQuery(" SELECT * FROM Clientes ; ");
             rs.first();
               // criando o objeto Contato
           clientes.setNome(rs.getString("Nome"));
            clientes.setBairro("Bairro");
            clientes.setCep((rs.getInt("cep")));
            clientes.setCidade(rs.getString("Cidade"));
            clientes.setCpf(rs.getInt("cpf"));
            clientes.setDataNasc(rs.getString("DataNasc"));
            clientes.setEstadocivil(rs.getString("EstadoCivil"));
            clientes.setGenero(rs.getString("sexo"));
            clientes.setRua(rs.getString("Rua"));
            clientes.setTelefResidencial(rs.getInt("telefone"));
            clientes.setTelefCelular(rs.getInt("Celular"));
            clientes.setEmail(rs.getString("Email"));
            clientes.setCategoria(rs.getString("Categoria"));
            clientes.setCodigo(rs.getInt("Cod_Cli"));
        }
         catch(SQLException sqle)
                {
                    String st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"Informação",1);

                }

        // adicionando o objeto à lista

       }
    public void movePrevious(Clientes clientes)
    {
        try{
         stmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
        
         //rs = stmt.executeQuery("SELECT Cod_Pro,Nome_Pro,Desc_Pro,Valor_Pro,CodFor_Pro FROM produtos");
       
           rs.previous();
       
                              // criando o objeto Contato
       clientes.setNome(rs.getString("Nome"));
            clientes.setBairro("Bairro");
            clientes.setCep((rs.getInt("cep")));
            clientes.setCidade(rs.getString("Cidade"));
            clientes.setCpf(rs.getInt("cpf"));
           clientes.setDataNasc(rs.getString("DataNasc"));
            clientes.setEstadocivil(rs.getString("EstadoCivil"));
            clientes.setGenero(rs.getString("sexo"));
            clientes.setRua(rs.getString("Rua"));
            clientes.setTelefResidencial(rs.getInt("telefone"));
            clientes.setTelefCelular(rs.getInt("Celular"));
            clientes.setEmail(rs.getString("Email"));
            clientes.setCategoria(rs.getString("Categoria"));
            clientes.setCodigo(rs.getInt("Cod_Cli"));
        } catch(SQLException sqle)
        {
            String t = "Primeiro registro\n não retorna mais ";

                    JOptionPane.showMessageDialog(null,t,"informação",1);

        }


        // adicionando o objeto à lista
    }
    public void moveProximo(Clientes clientes)
    {
        try{
        stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
        
        //rs = stmt.executeQuery("SELECT Cod_Pro,Nome_Pro,Desc_Pro,Valor_Pro,CodFor_Pro FROM produtos");
    
              
           rs.next();
    
                              // criando o objeto Contato
           clientes.setNome(rs.getString("Nome"));
            clientes.setBairro("Bairro");
            clientes.setCep((rs.getInt("cep")));
            clientes.setCidade(rs.getString("Cidade"));
            clientes.setCpf(rs.getInt("cpf"));
             clientes.setDataNasc(rs.getString("DataNasc"));
            clientes.setEstadocivil(rs.getString("EstadoCivil"));
            clientes.setGenero(rs.getString("sexo"));
            clientes.setRua(rs.getString("Rua"));
            clientes.setTelefResidencial(rs.getInt("telefone"));
            clientes.setTelefCelular(rs.getInt("Celular"));
            clientes.setEmail(rs.getString("Email"));
            clientes.setCategoria(rs.getString("Categoria"));
            clientes.setCodigo(rs.getInt("Cod_Cli"));
        }
        catch(SQLException sqle)
        {
            String t = "Ultimo Registro \n Não avança mais";

                    JOptionPane.showMessageDialog(null,t,"Informação",1);

        }
            
    }
    public void moveUltimo(Clientes clientes) throws SQLException
    {
       try{
           stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
        rs = stmt.executeQuery(" SELECT * FROM clientes ; ");

       rs.last();
               // criando o objeto Contato


         clientes.setNome(rs.getString("Nome"));
            clientes.setBairro("Bairro");
            clientes.setCep((rs.getInt("cep")));
            clientes.setCidade(rs.getString("Cidade"));
            clientes.setCpf(rs.getInt("cpf"));
             clientes.setDataNasc(rs.getString("DataNasc"));
            clientes.setEstadocivil(rs.getString("EstadoCivil"));
            clientes.setGenero(rs.getString("sexo"));
            clientes.setRua(rs.getString("Rua"));
            clientes.setTelefResidencial(rs.getInt("telefone"));
            clientes.setTelefCelular(rs.getInt("Celular"));
            clientes.setEmail(rs.getString("Email"));
            clientes.setCategoria(rs.getString("Categoria"));
            clientes.setCodigo(rs.getInt("Cod_Cli"));
       } catch(SQLException sqle)
       {
        String    st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

        }


       
    }
    public void entrada(Clientes clientes) throws SQLException
    {
        stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
        
       
        rs = stmt.executeQuery(" SELECT * FROM Clientes ; ");
        rs.last();
        int num=rs.getRow();
      
        if (num==0)
           
        {

            Inclusao(clientes);
           
           
        }
        else
        {
          moveFirst(clientes);
          moveUltimo(clientes);
        }
       
   
   
    }
   


 public void fechar() throws SQLException{
 rs.close();
 stmt.close();
 connection.close();    

 }

 public int getLinhha() throws SQLException
 {
    return rs.getRow();
    //return rs.getRow();

 }



}


e agora a parte mais dificil a interface espero que a sua seja melhor que a minha 

pois cria uma pacote Visao onde deve constar a classe
clienteVisao.java


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CadastroCliente.java
 *
 * Created on 14/Jun/2009, 5:59:37
 */

package Visao;

import Dao.*;
import Modelo.*;
import java.sql.Date;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author Herlander
 */
public class CadastroCliente extends javax.swing.JFrame {


    private javax.swing.JButton btAlterar;
    private javax.swing.JButton btAnterior;
    private javax.swing.JButton btCancelar;
    private javax.swing.JButton btGravar;
    private javax.swing.JButton btIncluir;
    private javax.swing.JButton btPrimeiro;
    private javax.swing.JButton btProximo;
    private javax.swing.JButton btRemover;
    private javax.swing.JButton btUltimo;
    private javax.swing.JButton btVoltar;
    private javax.swing.JComboBox cboEstadoCivil;
    private javax.swing.JComboBox cboGenero;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JLabel lbBairro;
    private javax.swing.JLabel lbCEP;
    private javax.swing.JLabel lbCPF;
    private javax.swing.JLabel lbCategoria;
    private javax.swing.JLabel lbCidade;
    private javax.swing.JLabel lbData;
    private javax.swing.JLabel lbEstadoCivil;
    private javax.swing.JLabel lbGenero;
    private javax.swing.JLabel lbLinha;
    private javax.swing.JLabel lbNome;
    private javax.swing.JLabel lbRotulo;
    private javax.swing.JLabel lbRua;
    private javax.swing.JTextField txtBairro;
    private javax.swing.JTextField txtCPF;
    private javax.swing.JTextField txtCategoria;
    private javax.swing.JTextField txtCelular;
    private javax.swing.JTextField txtCep;
    private javax.swing.JTextField txtCidade;
    private javax.swing.JTextField txtCodigo;
    private javax.swing.JTextField txtData;
    private javax.swing.JTextField txtEmail;
    private javax.swing.JTextField txtNome;
    private javax.swing.JTextField txtRua;
    private javax.swing.JTextField txtTelefone1;


    ClienteDao clienteDao;
    Clientes cliente;



    /** Creates new form CadastroCliente */
    public CadastroCliente() throws SQLException {
        cliente=new Clientes();
        clienteDao = new ClienteDao();
        initComponents();
        txtCodigo.setVisible(false);
        setResizable(false);
        setSize(550, 600);
        setVisible(true);
        setLocationRelativeTo(null);

        txtCodigo.setEditable(false);
        btGravar.setEnabled(false);
        btCancelar.setEnabled(false);
        DesabilitarRegistro();

         try
        {
        clienteDao.entrada(cliente);
        txtCodigo.setText(String.valueOf(cliente.getCodigo()));
        txtNome.setText(cliente.getNome());
        txtBairro.setText(cliente.getBairro());
        txtCPF.setText(String.valueOf(cliente.getCpf()));
        txtCep.setText(String.valueOf(cliente.getCep()));
        txtCategoria.setText(cliente.getCategoria());
        txtCidade.setText(cliente.getCidade());
        txtRua.setText(cliente.getRua());
        txtData.setText(String.valueOf(cliente.getDataNasc()));
        txtTelefone1.setText(String.valueOf(cliente.getTelefResidencial()));
        txtCelular.setText(String.valueOf(cliente.getTelefCelular()));
        txtEmail.setText(cliente.getEmail());
        cboEstadoCivil.setSelectedItem(cliente.getEstadocivil());
        cboGenero.setSelectedItem(cliente.getGenero());
        lbLinha.setText("Registro Numero "+ clienteDao.getLinhha() );

        }
        catch(SQLException sqle)
        {
           String st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

        }

       
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        lbRotulo = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        lbNome = new javax.swing.JLabel();
        lbCPF = new javax.swing.JLabel();
        txtNome = new javax.swing.JTextField();
        txtCPF = new javax.swing.JTextField();
        btPrimeiro = new javax.swing.JButton();
        btAnterior = new javax.swing.JButton();
        btProximo = new javax.swing.JButton();
        btUltimo = new javax.swing.JButton();
        lbGenero = new javax.swing.JLabel();
        cboGenero = new javax.swing.JComboBox();
        lbEstadoCivil = new javax.swing.JLabel();
        cboEstadoCivil = new javax.swing.JComboBox();
        lbData = new javax.swing.JLabel();
        lbCidade = new javax.swing.JLabel();
        txtCidade = new javax.swing.JTextField();
        lbCEP = new javax.swing.JLabel();
        txtCep = new javax.swing.JTextField();
        lbBairro = new javax.swing.JLabel();
        txtBairro = new javax.swing.JTextField();
        lbRua = new javax.swing.JLabel();
        txtRua = new javax.swing.JTextField();
        lbCategoria = new javax.swing.JLabel();
        txtCategoria = new javax.swing.JTextField();
        txtCodigo = new javax.swing.JTextField();
        lbLinha = new javax.swing.JLabel();
        txtData = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        txtEmail = new javax.swing.JTextField();
        txtTelefone1 = new javax.swing.JTextField();
        txtCelular = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        btIncluir = new javax.swing.JButton();
        btAlterar = new javax.swing.JButton();
        btRemover = new javax.swing.JButton();
        btGravar = new javax.swing.JButton();
        btCancelar = new javax.swing.JButton();
        btVoltar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Cadastro de Clientes");
        setBackground(new java.awt.Color(255, 255, 255));
        getContentPane().setLayout(null);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setLayout(null);

        lbRotulo.setBackground(new java.awt.Color(0, 51, 153));
        lbRotulo.setFont(new java.awt.Font("White Bold", 1, 24));
        lbRotulo.setForeground(new java.awt.Color(153, 102, 0));
        lbRotulo.setText("Cadastro de Clientes");
        jPanel1.add(lbRotulo);
        lbRotulo.setBounds(70, 30, 370, 26);

        getContentPane().add(jPanel1);
        jPanel1.setBounds(20, 10, 490, 80);

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(153, 102, 0)), "Dados Pessoais", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Seabird Heavy SF", 2, 18), new java.awt.Color(0, 0, 153))); // NOI18N
        jPanel2.setLayout(null);

        lbNome.setFont(new java.awt.Font("Seabird SF", 1, 14));
        lbNome.setForeground(new java.awt.Color(153, 102, 0));
        lbNome.setText("Nome");
        jPanel2.add(lbNome);
        lbNome.setBounds(10, 50, 40, 20);

        lbCPF.setFont(new java.awt.Font("Seabird SF", 1, 14));
        lbCPF.setForeground(new java.awt.Color(153, 102, 0));
        lbCPF.setText("CPF");
        jPanel2.add(lbCPF);
        lbCPF.setBounds(10, 90, 40, 23);
        jPanel2.add(txtNome);
        txtNome.setBounds(70, 50, 300, 25);
        jPanel2.add(txtCPF);
        txtCPF.setBounds(70, 90, 100, 25);

        btPrimeiro.setText("<<");
        btPrimeiro.setToolTipText("Primeiro Cliente");
        btPrimeiro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btPrimeiroActionPerformed(evt);
            }
        });
        jPanel2.add(btPrimeiro);
        btPrimeiro.setBounds(180, 90, 50, 23);

        btAnterior.setText("<");
        btAnterior.setToolTipText("Anterior Cliente");
        btAnterior.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAnteriorActionPerformed(evt);
            }
        });
        jPanel2.add(btAnterior);
        btAnterior.setBounds(230, 90, 50, 23);

        btProximo.setText(">");
        btProximo.setToolTipText("Proximo Cliente");
        btProximo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btProximoActionPerformed(evt);
            }
        });
        jPanel2.add(btProximo);
        btProximo.setBounds(280, 90, 50, 23);

        btUltimo.setText(">>");
        btUltimo.setToolTipText("Ultimo Cliente");
        btUltimo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btUltimoActionPerformed(evt);
            }
        });
        jPanel2.add(btUltimo);
        btUltimo.setBounds(330, 90, 50, 23);

        lbGenero.setFont(new java.awt.Font("Seabird SF", 1, 14));
        lbGenero.setForeground(new java.awt.Color(153, 102, 0));
        lbGenero.setText("Genero");
        jPanel2.add(lbGenero);
        lbGenero.setBounds(10, 130, 50, 25);

        cboGenero.setMaximumRowCount(3);
        cboGenero.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Genero", "Masculino", "Femenino", " ", " " }));
        jPanel2.add(cboGenero);
        cboGenero.setBounds(70, 130, 130, 25);

        lbEstadoCivil.setFont(new java.awt.Font("Seabird SF", 1, 14));
        lbEstadoCivil.setForeground(new java.awt.Color(153, 102, 0));
        lbEstadoCivil.setText("Estado Civil");
        jPanel2.add(lbEstadoCivil);
        lbEstadoCivil.setBounds(240, 130, 90, 25);

        cboEstadoCivil.setMaximumRowCount(3);
        cboEstadoCivil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Estado Civil", "Solteiro(a)", "Casado(a)", "Viuvo(a)", "Divorciado(a)" }));
        jPanel2.add(cboEstadoCivil);
        cboEstadoCivil.setBounds(330, 130, 150, 25);

        lbData.setFont(new java.awt.Font("Seabird SF", 0, 14));
        lbData.setForeground(new java.awt.Color(153, 102, 0));
        lbData.setText("Data de Nasc.");
        jPanel2.add(lbData);
        lbData.setBounds(10, 170, 90, 25);

        lbCidade.setFont(new java.awt.Font("Seabird SF", 1, 14));
        lbCidade.setForeground(new java.awt.Color(153, 102, 0));
        lbCidade.setText("Cidade");
        jPanel2.add(lbCidade);
        lbCidade.setBounds(10, 210, 50, 25);
        jPanel2.add(txtCidade);
        txtCidade.setBounds(70, 210, 170, 25);

        lbCEP.setFont(new java.awt.Font("Seabird SF", 1, 14));
        lbCEP.setForeground(new java.awt.Color(153, 102, 0));
        lbCEP.setText("CEP");
        jPanel2.add(lbCEP);
        lbCEP.setBounds(290, 170, 24, 25);
        jPanel2.add(txtCep);
        txtCep.setBounds(330, 170, 150, 25);

        lbBairro.setFont(new java.awt.Font("Tahoma", 1, 14));
        lbBairro.setForeground(new java.awt.Color(153, 102, 0));
        lbBairro.setText("Bairro");
        jPanel2.add(lbBairro);
        lbBairro.setBounds(280, 210, 50, 25);
        jPanel2.add(txtBairro);
        txtBairro.setBounds(330, 210, 150, 25);

        lbRua.setFont(new java.awt.Font("Seabird SF", 1, 14));
        lbRua.setForeground(new java.awt.Color(153, 102, 0));
        lbRua.setText("Rua");
        jPanel2.add(lbRua);
        lbRua.setBounds(20, 260, 30, 16);
        jPanel2.add(txtRua);
        txtRua.setBounds(70, 250, 170, 25);

        lbCategoria.setFont(new java.awt.Font("Seabird SF", 1, 14));
        lbCategoria.setForeground(new java.awt.Color(153, 102, 0));
        lbCategoria.setText("Categoria");
        jPanel2.add(lbCategoria);
        lbCategoria.setBounds(260, 260, 70, 16);
        jPanel2.add(txtCategoria);
        txtCategoria.setBounds(330, 250, 150, 25);
        jPanel2.add(txtCodigo);
        txtCodigo.setBounds(380, 50, 90, 23);

        lbLinha.setFont(new java.awt.Font("Verdana", 3, 12)); // NOI18N
        lbLinha.setForeground(new java.awt.Color(255, 51, 51));
        jPanel2.add(lbLinha);
        lbLinha.setBounds(280, 20, 200, 20);
        jPanel2.add(txtData);
        txtData.setBounds(100, 170, 150, 20);

        getContentPane().add(jPanel2);
        jPanel2.setBounds(20, 90, 490, 290);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(153, 102, 0)), "Contactos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Seabird Heavy SF", 2, 18), new java.awt.Color(0, 0, 153))); // NOI18N
        jPanel3.setForeground(new java.awt.Color(153, 102, 0));
        jPanel3.setLayout(null);

        jLabel11.setFont(new java.awt.Font("Seabird SF", 1, 14));
        jLabel11.setForeground(new java.awt.Color(153, 102, 0));
        jLabel11.setText("Celular");
        jPanel3.add(jLabel11);
        jLabel11.setBounds(270, 30, 50, 25);

        jLabel12.setFont(new java.awt.Font("Seabird SF", 1, 14));
        jLabel12.setForeground(new java.awt.Color(153, 102, 0));
        jLabel12.setText("Telef.");
        jPanel3.add(jLabel12);
        jLabel12.setBounds(10, 30, 40, 25);

        jLabel13.setFont(new java.awt.Font("Seabird SF", 1, 14));
        jLabel13.setForeground(new java.awt.Color(153, 102, 0));
        jLabel13.setText("Email");
        jPanel3.add(jLabel13);
        jLabel13.setBounds(10, 70, 40, 25);
        jPanel3.add(txtEmail);
        txtEmail.setBounds(60, 70, 420, 25);
        jPanel3.add(txtTelefone1);
        txtTelefone1.setBounds(60, 30, 190, 23);
        jPanel3.add(txtCelular);
        txtCelular.setBounds(320, 30, 160, 23);

        getContentPane().add(jPanel3);
        jPanel3.setBounds(20, 390, 490, 110);

        btIncluir.setText("Incluir");
        btIncluir.setToolTipText("incluir Cliente");
        btIncluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btIncluirActionPerformed(evt);
            }
        });
        jPanel4.add(btIncluir);

        btAlterar.setText("Alterar");
        btAlterar.setToolTipText("Alterar Cliente");
        btAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAlterarActionPerformed(evt);
            }
        });
        jPanel4.add(btAlterar);

        btRemover.setText("Remover");
        btRemover.setToolTipText("Remover Cliente");
        btRemover.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btRemoverActionPerformed(evt);
            }
        });
        jPanel4.add(btRemover);

        btGravar.setText("Gravar");
        btGravar.setToolTipText("Gravar Cliente");
        btGravar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btGravarActionPerformed(evt);
            }
        });
        jPanel4.add(btGravar);

        btCancelar.setText("Cancelar");
        btCancelar.setToolTipText("Cancelar Registro");
        btCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelarActionPerformed(evt);
            }
        });
        jPanel4.add(btCancelar);

        btVoltar.setText("Voltar");
        btVoltar.setToolTipText("Voltar");
        btVoltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btVoltarActionPerformed(evt);
            }
        });
        jPanel4.add(btVoltar);

        getContentPane().add(jPanel4);
        jPanel4.setBounds(20, 510, 500, 30);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelarActionPerformed
        // TODO add your handling code here:
        limparRegistro();
        habilitarbotao();
        btGravar.setEnabled(false);
        btCancelar.setEnabled(false);
        try {
            clienteDao.Delete(cliente);
        } catch (SQLException sqle) {
            String st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

        }
    }//GEN-LAST:event_btCancelarActionPerformed

    private void btVoltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btVoltarActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_btVoltarActionPerformed

    private void btPrimeiroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btPrimeiroActionPerformed
        // TODO add your handling code here:

        try {
                        clienteDao.moveFirst(cliente);
                        lbLinha.setText("Registro Numero "+ clienteDao.getLinhha());
                        txtCodigo.setText(String.valueOf(cliente.getCodigo()));
                        txtNome.setText(cliente.getNome());
                        txtBairro.setText(cliente.getBairro());
                        txtCPF.setText(String.valueOf(cliente.getCpf()));
                        txtCep.setText(String.valueOf(cliente.getCep()));
                        txtCategoria.setText(cliente.getCategoria());
                        txtCidade.setText(cliente.getCidade());
                        txtRua.setText(cliente.getRua());
                        txtData.setText(String.valueOf(cliente.getDataNasc()));
                        txtTelefone1.setText(String.valueOf(cliente.getTelefResidencial()));
                        txtCelular.setText(String.valueOf(cliente.getTelefCelular()));
                        txtEmail.setText(cliente.getEmail());
                        cboEstadoCivil.setSelectedItem(cliente.getEstadocivil());
                        cboGenero.setSelectedItem(cliente.getGenero());


                    }
                    catch(SQLException sqle)
                {
                   String st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

                }
    }//GEN-LAST:event_btPrimeiroActionPerformed

    private void btAnteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAnteriorActionPerformed
        // TODO add your handling code here:
           try {
                        clienteDao.movePrevious(cliente);
                        lbLinha.setText("Registro Numero "+ clienteDao.getLinhha());
                        txtCodigo.setText(String.valueOf(cliente.getCodigo()));
                        txtNome.setText(cliente.getNome());
                        txtBairro.setText(cliente.getBairro());
                        txtCPF.setText(String.valueOf(cliente.getCpf()));
                        txtCep.setText(String.valueOf(cliente.getCep()));
                        txtCategoria.setText(cliente.getCategoria());
                        txtCidade.setText(cliente.getCidade());
                        txtRua.setText(cliente.getRua());
                        txtData.setText(String.valueOf(cliente.getDataNasc()));
                        txtTelefone1.setText(String.valueOf(cliente.getTelefResidencial()));
                        txtCelular.setText(String.valueOf(cliente.getTelefCelular()));
                        txtEmail.setText(cliente.getEmail());
                        cboEstadoCivil.setSelectedItem(cliente.getEstadocivil());
                        cboGenero.setSelectedItem(cliente.getGenero());


                    }
                    catch(SQLException sqle)
                {
                   String st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

                }


    }//GEN-LAST:event_btAnteriorActionPerformed

    private void btProximoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btProximoActionPerformed
        // TODO add your handling code here:
         try {
                        clienteDao.moveProximo(cliente);
                        lbLinha.setText("Registro Numero "+ clienteDao.getLinhha());
                        txtCodigo.setText(String.valueOf(cliente.getCodigo()));
                        txtNome.setText(cliente.getNome());
                        txtBairro.setText(cliente.getBairro());
                        txtCPF.setText(String.valueOf(cliente.getCpf()));
                        txtCep.setText(String.valueOf(cliente.getCep()));
                        txtCategoria.setText(cliente.getCategoria());
                        txtCidade.setText(cliente.getCidade());
                        txtRua.setText(cliente.getRua());
                        txtData.setText(String.valueOf(cliente.getDataNasc()));
                        txtTelefone1.setText(String.valueOf(cliente.getTelefResidencial()));
                        txtCelular.setText(String.valueOf(cliente.getTelefCelular()));
                        txtEmail.setText(cliente.getEmail());
                        cboEstadoCivil.setSelectedItem(cliente.getEstadocivil());
                        cboGenero.setSelectedItem(cliente.getGenero());


                    }
                    catch(SQLException sqle)
                {
                   String st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

                }
    }//GEN-LAST:event_btProximoActionPerformed

    private void btUltimoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btUltimoActionPerformed
        // TODO add your handling code here:
         try {
                        clienteDao.moveUltimo(cliente);
                        lbLinha.setText("Registro Numero "+ clienteDao.getLinhha());
                        txtCodigo.setText(String.valueOf(cliente.getCodigo()));
                        txtNome.setText(cliente.getNome());
                        txtBairro.setText(cliente.getBairro());
                        txtCPF.setText(String.valueOf(cliente.getCpf()));
                        txtCep.setText(String.valueOf(cliente.getCep()));
                        txtCategoria.setText(cliente.getCategoria());
                        txtCidade.setText(cliente.getCidade());
                        txtRua.setText(cliente.getRua());
                        txtData.setText(String.valueOf(cliente.getDataNasc()));
                        txtTelefone1.setText(String.valueOf(cliente.getTelefResidencial()));
                        txtCelular.setText(String.valueOf(cliente.getTelefCelular()));
                        txtEmail.setText(cliente.getEmail());
                        cboEstadoCivil.setSelectedItem(cliente.getEstadocivil());
                        cboGenero.setSelectedItem(cliente.getGenero());


                    }
                    catch(SQLException sqle)
                {
                   String st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

                }
    }//GEN-LAST:event_btUltimoActionPerformed

    private void btIncluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btIncluirActionPerformed
        // TODO add your handling code here:
         try {

                    clienteDao.Inclusao(cliente);

                    lbLinha.setText("Registro Numero "+ clienteDao.getLinhha());
                     txtCodigo.setText(String.valueOf(cliente.getCodigo()));
                      txtNome.setText(cliente.getNome());
                        txtBairro.setText(cliente.getBairro());
                        txtCPF.setText(String.valueOf(cliente.getCpf()));
                        txtCep.setText(String.valueOf(cliente.getCep()));
                        txtCategoria.setText(cliente.getCategoria());
                        txtCidade.setText(cliente.getCidade());
                        txtRua.setText(cliente.getRua());
                        txtData.setText(String.valueOf(cliente.getDataNasc()));
                        txtTelefone1.setText(String.valueOf(cliente.getTelefResidencial()));
                        txtCelular.setText(String.valueOf(cliente.getTelefCelular()));
                        txtEmail.setText(cliente.getEmail());
                        cboEstadoCivil.setSelectedItem(cliente.getEstadocivil());
                        cboGenero.setSelectedItem(cliente.getGenero());




                   String st= "permitido a incluido de dados";
                    JOptionPane.showMessageDialog(null,st, "Informacao",1);



                }
                    catch(SQLException sqle)
                {
                  String  st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

                }
              desabilitarbotao();
              btGravar.setEnabled(true);
              btCancelar.setEnabled(true);
              HabilitarRegistro();


    }//GEN-LAST:event_btIncluirActionPerformed

    private void btAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAlterarActionPerformed
        // TODO add your handling code here:
         desabilitarbotao();
          btGravar.setEnabled(true);
         btCancelar.setEnabled(true);
         HabilitarRegistro();
    }//GEN-LAST:event_btAlterarActionPerformed

    private void btRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btRemoverActionPerformed
        // TODO add your handling code here:

         cliente.setCodigo(Integer.parseInt(txtCodigo.getText()));
                  
                try {
                    clienteDao.Delete(cliente);


                    String st= "Registro Excluido com sucesso";
                    JOptionPane.showMessageDialog(null,st, "Informacao",1);
                  limparRegistro();

                   /*produtoDAO.moveFirst(produto);
                    lblinha.setText("registro numero "+ produtoDAO.getLinhha());
                    txtCodigo.setText(String.valueOf(produto.getCod()));
                    txtNome.setText(produto.getNome());
                    txtDescricao.setText(produto.getDescricao());
                    txtValor.setText(String.valueOf(produto.getValor()));
                    txtCodFor.setText(String.valueOf(produto.getCodFor()));
                    */


                }
                    catch(SQLException sqle)
                {
                  String  st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

                }

    }//GEN-LAST:event_btRemoverActionPerformed

    private void btGravarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btGravarActionPerformed
        // TODO add your handling code here:


           cliente.setCodigo(Integer.parseInt(txtCodigo.getText()));
           cliente.setNome(txtNome.getText());
           cliente.setBairro(txtBairro.getText());
           cliente.setCep((Integer.parseInt(txtCep.getText())));
           cliente.setCidade(txtCidade.getText());
           cliente.setCpf(Integer.parseInt(txtCPF.getText()));
           cliente.setDataNasc(String.valueOf(txtData.getText()));
           cliente.setEstadocivil(cboEstadoCivil.getSelectedItem().toString());
           cliente.setGenero(cboGenero.getSelectedItem().toString());
           cliente.setRua(txtRua.getText());
           cliente.setTelefResidencial(Integer.parseInt(txtTelefone1.getText()));
           cliente.setTelefCelular(Integer.parseInt(txtCelular.getText()));
           cliente.setEmail(txtEmail.getText());
           cliente.setCategoria(txtCategoria.getText());

                try {
                        clienteDao.adicionar(cliente);
                        lbLinha.setText("Registro Numero "+ clienteDao.getLinhha());
                        txtCodigo.setText(String.valueOf(cliente.getCodigo()));
                        txtNome.setText(cliente.getNome());
                        txtBairro.setText(cliente.getBairro());
                        txtCPF.setText(String.valueOf(cliente.getCpf()));
                        txtCep.setText(String.valueOf(cliente.getCep()));
                        txtCategoria.setText(cliente.getCategoria());
                        txtCidade.setText(cliente.getCidade());
                        txtRua.setText(cliente.getRua());
                        txtData.setText(String.valueOf(cliente.getDataNasc()));
                        txtTelefone1.setText(String.valueOf(cliente.getTelefResidencial()));
                        txtCelular.setText(String.valueOf(cliente.getTelefCelular()));
                        txtEmail.setText(cliente.getEmail());
                        cboEstadoCivil.setSelectedItem(cliente.getEstadocivil());
                        cboGenero.setSelectedItem(cliente.getGenero());

                 String    st= "Registro incluido com sucesso";
                    JOptionPane.showMessageDialog(null,st, "Informacao",1);

                   limparRegistro();
                    /*produtoDAO.moveProximo(produto);
                    produtoDAO.movePrevious(produto);
                    lblinha.setText("registro numero "+ produtoDAO.getLinhha());
                    txtCodigo.setText(String.valueOf(produto.getCod()));
                    txtNome.setText(produto.getNome());
                    txtDescricao.setText(produto.getDescricao());
                    txtValor.setText(String.valueOf(produto.getValor()));
                    txtCodFor.setText(String.valueOf(produto.getCodFor()));
                   */


                }
                    catch(SQLException sqle)
                {
                   String st = "Erro ocorrido!"+"\n Codigo: "+ sqle.getErrorCode()+
                    "\nMensagem: " + sqle.getMessage();
                    JOptionPane.showMessageDialog(null,st,"ERRO",0);

                }
               habilitarbotao();
               btGravar.setEnabled(false);
               btCancelar.setEnabled(false);
               DesabilitarRegistro();


    }//GEN-LAST:event_btGravarActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) throws SQLException {
       
                new CadastroCliente().setVisible(true);
      
    }
     public void habilitarbotao()
    {
        btAlterar.setEnabled(true);
        btAnterior.setEnabled(true);
        btCancelar.setEnabled(true);
        btRemover.setEnabled(true);
        btVoltar.setEnabled(true);
        btGravar.setEnabled(true);
        btIncluir.setEnabled(true);
        btPrimeiro.setEnabled(true);
        btProximo.setEnabled(true);
        btUltimo.setEnabled(true);

    }
    public void desabilitarbotao()
    {
        btAlterar.setEnabled(false);
        btAnterior.setEnabled(false);
        btCancelar.setEnabled(false);
        btRemover.setEnabled(false);
        btVoltar.setEnabled(false);
        btGravar.setEnabled(false);
        btIncluir.setEnabled(false);
        btPrimeiro.setEnabled(false);
        btProximo.setEnabled(false);
        btUltimo.setEnabled(false);

    }

      public void DesabilitarRegistro()
    {
        txtCodigo.setEditable(false);txtCodigo.setVisible(false);
        txtNome.setEditable(false);
        txtBairro.setEditable(false);
        txtCPF.setEditable(false);
        txtCep.setEditable(false);
        txtCategoria.setEditable(false);
        txtCidade.setEditable(false);
        txtRua.setEditable(false);
        txtData.setEditable(false);
        txtTelefone1.setEditable(false);
        txtCelular.setEditable(false);
        txtEmail.setEditable(false);
        cboEstadoCivil.setSelectedItem("Estado Civil");
        cboGenero.setSelectedItem("Genero");



    }
       public void limparRegistro()
    {
        txtCodigo.setEditable(false);txtCodigo.setVisible(false);
        txtNome.setText(null);
        txtBairro.setText(null);
        txtCPF.setText(null);
        txtCep.setText(null);
        txtCategoria.setText(null);
        txtCidade.setText(null);
        txtRua.setText(null);
        txtData.setText(null);
        txtTelefone1.setText(null);
        txtCelular.setText(null);
        txtEmail.setText(null);
        cboEstadoCivil.setSelectedItem("Estado Civil");
        cboGenero.setSelectedItem("Genero");



    }
     public void HabilitarRegistro()
    {
        txtCodigo.setEditable(false);txtCodigo.setVisible(false);
       txtNome.setEditable(true);
        txtBairro.setEditable(true);
        txtCPF.setEditable(true);
        txtCep.setEditable(true);
        txtCategoria.setEditable(true);
        txtCidade.setEditable(true);
        txtRua.setEditable(true);
        txtData.setEditable(true);
        txtTelefone1.setEditable(true);
        txtCelular.setEditable(true);
        txtEmail.setEditable(true);
        cboGenero.setSelectedItem("Genero");
        cboEstadoCivil.setSelectedItem("Estado Civil");
       
       

    }


  
   
}


ok  qualquer coisa em modesto.dad@gmail.com