Versão atual:

Dificuldade em fazer uma ArrayList,

Eu começei a fazer minha arraylist mas travei aqui e não consigo terminar. Vou colocar os dados das 3 classes do meu código juntamente com uma foto do meu banco de dados do qual preciso puxar os dados para preencher a arraylist.

Classe BD( conexão com o banco de dados)

import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import java.util.ArrayList;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author alunos
 */
public class BD {

    private Statement stm = null;
    private ResultSet res = null;
    private Connection conn = null;
    private String URL = "jdbc:mysql://localhost:3306/bdcobranca";
    private String username = "root";
    private String password = "123";
    private String driver = "com.mysql.jdbc.Driver";

    public void conecta(){
        try {
            Class.forName(driver);
            conn =  DriverManager.getConnection(URL, username, password);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void desconecta(){
        try {
            conn.close();
        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void inserir(String query){
        try {
            stm = conn.createStatement();
            stm.execute(query);
            stm.close();
            JOptionPane.showMessageDialog(null, "Dados cadastrados com sucesso!! ");
        } catch (SQLException ex) {
               System.out.println(ex.getMessage());
        }

    }

    public void apagar(int idpessoafisica) {
        String query = "DELETE FROM `pessoafisica` WHERE idpessoafisica = " + idpessoafisica;
        try {
            conecta();
            stm = conn.createStatement();
            int resposta = JOptionPane.showConfirmDialog(null, "Deseja excluir o registro?", "Excluir", JOptionPane.YES_NO_OPTION);
            if (resposta == JOptionPane.YES_OPTION) {
                stm.executeUpdate(query); //Essa é a linha que realiza a exclusão
            }
            desconecta();
        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void alterar(int idpessoafisica, String Nome, String CPF, String Endereco, String Telefone, String Cidade){

          String query = "update pessoafisica set nome = '"+Nome+"', cpf = '"+CPF+"', endereco = '"+Endereco+"', telefone = '"+Telefone+"', cidade = '"+Cidade+"' where idpessoafisica = "+idpessoafisica;
        try {
            conecta();
            stm = conn.createStatement();
            stm.executeUpdate(query);
            JOptionPane.showMessageDialog(null, "Alteração realizada com sucesso!");

        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    public ResultSet recuperarDadosCliente(int idpessoafisica) {

        String query = "SELECT * FROM `pessoafisica` WHERE idpessoafisica = " + idpessoafisica;
        try {
            conecta();
            stm = conn.createStatement();
            res = stm.executeQuery(query);
            /*while (res.next()){
             System.out.println("Nome: "+res.getString(2));
             System.out.println("id: "+res.getString(1));
             System.out.println("telefone: "+res.getString(3));
             }*/

        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }

        return res;

    }

    public ResultSet recuperarDadosClientepj(int idpj) {

        String query = "SELECT * FROM `pessoajuridica` WHERE idpessoajuridica = " + idpj;
        try {
            conecta();
            stm = conn.createStatement();
            res = stm.executeQuery(query);
            /*while (res.next()){
             System.out.println("Nome: "+res.getString(2));
             System.out.println("id: "+res.getString(1));
             System.out.println("telefone: "+res.getString(3));
             }*/

        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }

        return res;
    }

    public void alterarpj(int idpj, String nomepj, String cnpj, String enderecopj, String telefonepj, String cidadepj){

          String query = "update pessoajuridica set nome = '"+nomepj+"', cnpj = '"+cnpj+"', endereco = '"+enderecopj+"', telefone = '"+telefonepj+"', cidade = '"+cidadepj+"' where idpessoajuridica = "+idpj;
        try {
            conecta();
            stm = conn.createStatement();
            stm.executeUpdate(query);
            JOptionPane.showMessageDialog(null, "Alteração realizada com sucesso!");

        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    public void apagarpj(int idpj) {
        String query = "DELETE FROM `pessoajuridica` WHERE idpessoajuridica = " +idpj;
        try {
            conecta();
            stm = conn.createStatement();
            int resposta = JOptionPane.showConfirmDialog(null, "Deseja excluir o registro?", "Excluir", JOptionPane.YES_NO_OPTION);
            if (resposta == JOptionPane.YES_OPTION) {
                stm.executeUpdate(query); //Essa é a linha que realiza a exclusão
            }
            desconecta();
        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }
    }


}



Classe menu(onde ta os paineis e jtexts)


import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.ArrayList;
import java.util.Arrays;
import javax.swing.JOptionPane;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Renata Silva
 */
public class Menu extends javax.swing.JFrame {

    /**
     * Creates new form NewJFrame
     */
    public Menu() {
        initComponents();
    }

    /**
     * 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">                          
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel4 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        btClientesCadastrados = new javax.swing.JButton();
        btTitulosCadastrados = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        nomePessoaFisica = new javax.swing.JTextField();
        cpf = new javax.swing.JTextField();
        enderecoPessoaFisica = new javax.swing.JTextField();
        telefonePessoaFisica = new javax.swing.JTextField();
        cidadePessoaFisica = new javax.swing.JTextField();
        btSalvarPessoaFisica = new javax.swing.JButton();
        btLimpar = new javax.swing.JButton();
        btSair = new javax.swing.JButton();
        jLabel18 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jLabel22 = new javax.swing.JLabel();
        idPessoafisica = new javax.swing.JTextField();
        buscar = new javax.swing.JButton();
        alterar = new javax.swing.JButton();
        apagar = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        nomePessoaJuridica = new javax.swing.JTextField();
        Cnpj = new javax.swing.JTextField();
        enderecoPessoaJuridica = new javax.swing.JTextField();
        telefonePessoaJuridica = new javax.swing.JTextField();
        cidadePessoaJuridica = new javax.swing.JTextField();
        SalvarPessoaJuridica = new javax.swing.JButton();
        btLimparpj = new javax.swing.JButton();
        btSairpj = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        idpessoaj = new javax.swing.JTextField();
        buscarpj = new javax.swing.JButton();
        alterarpj = new javax.swing.JButton();
        apagarpj = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        btSalvarTit = new javax.swing.JButton();
        btLimparTitulo = new javax.swing.JButton();
        btSairTitulo = new javax.swing.JButton();
        valor_titulo = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        observacao_titulo = new javax.swing.JTextField();
        data_vencimento = new javax.swing.JTextField();
        data_compra = new javax.swing.JTextField();
        jPanel8 = new javax.swing.JPanel();
        jLabel24 = new javax.swing.JLabel();
        idtitulos = new javax.swing.JTextField();
        buscartitulo = new javax.swing.JButton();
        alterartitulo = new javax.swing.JButton();
        apagartitulo = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbclientes = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbclientes1 = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel15.setText("Clientes Cadastrados");

        jLabel19.setText("Títulos Cadastrados");

        btClientesCadastrados.setIcon(new javax.swing.ImageIcon("D:\\Área de Trabalho\\lupa.png")); // NOI18N

        btTitulosCadastrados.setIcon(new javax.swing.ImageIcon("D:\\Área de Trabalho\\lupa.png")); // NOI18N
        btTitulosCadastrados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btTitulosCadastradosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(72, 72, 72)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel15)
                    .addComponent(jLabel19))
                .addGap(35, 35, 35)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btTitulosCadastrados, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btClientesCadastrados, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(556, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btClientesCadastrados)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addComponent(jLabel15)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 578, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btTitulosCadastrados)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel19)
                        .addGap(13, 13, 13)))
                .addGap(73, 73, 73))
        );

        jTabbedPane1.addTab("Relatórios", jPanel4);

        jLabel20.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel20.setText("Desenvolvido por: Renata Souza Silva");

        jLabel21.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel21.setText("Contato: renata-souza-silva@hotmail.com");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(530, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addComponent(jLabel20)
                .addGap(27, 27, 27)
                .addComponent(jLabel21)
                .addContainerGap(676, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Sobre", jPanel5);

        jLabel1.setText("Nome:");

        jLabel2.setText("Endereço:");

        jLabel3.setText("Telefone:");

        jLabel4.setText("Cidade:");

        jLabel5.setText("CPF:");

        cidadePessoaFisica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cidadePessoaFisicaActionPerformed(evt);
            }
        });

        btSalvarPessoaFisica.setText("Salvar");
        btSalvarPessoaFisica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarPessoaFisicaActionPerformed(evt);
            }
        });

        btLimpar.setText("Limpar");
        btLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btLimparActionPerformed(evt);
            }
        });

        btSair.setText("Sair");
        btSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSairActionPerformed(evt);
            }
        });

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Edições"));
        jPanel6.setToolTipText("");

        jLabel22.setText("Localizar cliente(id):");

        buscar.setText("Buscar");
        buscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buscarActionPerformed(evt);
            }
        });

        alterar.setText("Alterar");
        alterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                alterarActionPerformed(evt);
            }
        });

        apagar.setText("Apagar");
        apagar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                apagarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel22)
                .addGap(34, 34, 34)
                .addComponent(idPessoafisica, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(buscar)
                .addGap(36, 36, 36)
                .addComponent(alterar)
                .addGap(42, 42, 42)
                .addComponent(apagar)
                .addGap(0, 96, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(idPessoafisica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buscar)
                    .addComponent(alterar)
                    .addComponent(apagar)))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(188, 188, 188)
                .addComponent(btSalvarPessoaFisica)
                .addGap(18, 18, 18)
                .addComponent(btLimpar)
                .addGap(18, 18, 18)
                .addComponent(btSair, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4))
                                .addGap(70, 70, 70)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(telefonePessoaFisica, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
                                    .addComponent(cidadePessoaFisica)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel2))
                                .addGap(70, 70, 70)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(cpf)
                                    .addComponent(enderecoPessoaFisica)
                                    .addComponent(nomePessoaFisica))))
                        .addGap(202, 202, 202))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(101, 101, 101)
                        .addComponent(jLabel18)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(jLabel1))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(nomePessoaFisica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(jLabel5))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(enderecoPessoaFisica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(telefonePessoaFisica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cidadePessoaFisica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btLimpar)
                    .addComponent(btSalvarPessoaFisica)
                    .addComponent(btSair))
                .addGap(38, 38, 38)
                .addComponent(jLabel18)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Cadastro Pessoa Física", jPanel1);

        jLabel6.setText("Nome:");

        jLabel7.setText("CNPJ:");

        jLabel8.setText("Endereço:");

        jLabel9.setText("Telefone:");

        jLabel10.setText("Cidade:");

        SalvarPessoaJuridica.setText("Salvar");
        SalvarPessoaJuridica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SalvarPessoaJuridicaActionPerformed(evt);
            }
        });

        btLimparpj.setText("Limpar");
        btLimparpj.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btLimparpjActionPerformed(evt);
            }
        });

        btSairpj.setText("Sair");
        btSairpj.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSairpjActionPerformed(evt);
            }
        });

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Edições"));
        jPanel7.setToolTipText("");

        jLabel23.setText("Localizar cliente(id):");

        buscarpj.setText("Buscar");
        buscarpj.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buscarpjActionPerformed(evt);
            }
        });

        alterarpj.setText("Alterar");
        alterarpj.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                alterarpjActionPerformed(evt);
            }
        });

        apagarpj.setText("Apagar");
        apagarpj.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                apagarpjActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel23)
                .addGap(34, 34, 34)
                .addComponent(idpessoaj, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(buscarpj)
                .addGap(36, 36, 36)
                .addComponent(alterarpj)
                .addGap(42, 42, 42)
                .addComponent(apagarpj)
                .addGap(0, 96, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(idpessoaj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buscarpj)
                    .addComponent(alterarpj)
                    .addComponent(apagarpj)))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)
                            .addComponent(jLabel8)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10))
                        .addGap(89, 89, 89)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(SalvarPessoaJuridica)
                                .addGap(35, 35, 35)
                                .addComponent(btLimparpj)
                                .addGap(38, 38, 38)
                                .addComponent(btSairpj))
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(nomePessoaJuridica, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
                                .addComponent(Cnpj)
                                .addComponent(enderecoPessoaJuridica)
                                .addComponent(telefonePessoaJuridica)
                                .addComponent(cidadePessoaJuridica))))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(402, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(nomePessoaJuridica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(Cnpj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(enderecoPessoaJuridica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(telefonePessoaJuridica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(cidadePessoaJuridica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(SalvarPessoaJuridica)
                    .addComponent(btLimparpj)
                    .addComponent(btSairpj))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 387, Short.MAX_VALUE)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jTabbedPane1.addTab("Cadastro Pessoa Jurídica", jPanel2);

        jLabel11.setText("Nome do Cliente:");

        jLabel12.setText("Empresa Credora:");

        jLabel13.setText("Valor do Titulo:");

        jLabel14.setText("Data da Compra:");

        btSalvarTit.setText("Salvar");
        btSalvarTit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarTitActionPerformed(evt);
            }
        });

        btLimparTitulo.setText("Limpar");
        btLimparTitulo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btLimparTituloActionPerformed(evt);
            }
        });

        btSairTitulo.setText("Sair");
        btSairTitulo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSairTituloActionPerformed(evt);
            }
        });

        jLabel16.setText("Data de Vencimento:");

        jLabel17.setText("Observação:");

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Edições"));
        jPanel8.setToolTipText("");

        jLabel24.setText("Localizar cliente(id):");

        buscartitulo.setText("Buscar");
        buscartitulo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buscartituloActionPerformed(evt);
            }
        });

        alterartitulo.setText("Alterar");
        alterartitulo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                alterartituloActionPerformed(evt);
            }
        });

        apagartitulo.setText("Apagar");
        apagartitulo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                apagartituloActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel24)
                .addGap(34, 34, 34)
                .addComponent(idtitulos, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(buscartitulo)
                .addGap(36, 36, 36)
                .addComponent(alterartitulo)
                .addGap(42, 42, 42)
                .addComponent(apagartitulo)
                .addGap(0, 112, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(idtitulos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buscartitulo)
                    .addComponent(alterartitulo)
                    .addComponent(apagartitulo)))
        );

        tbclientes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(tbclientes);

        tbclientes1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane2.setViewportView(tbclientes1);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(326, 326, 326)
                .addComponent(btSalvarTit)
                .addGap(45, 45, 45)
                .addComponent(btLimparTitulo)
                .addGap(48, 48, 48)
                .addComponent(btSairTitulo)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel12)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel11)
                                .addGap(61, 61, 61)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(valor_titulo, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 334, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 334, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(data_compra, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(data_vencimento, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(observacao_titulo, javax.swing.GroupLayout.DEFAULT_SIZE, 608, Short.MAX_VALUE)))
                            .addComponent(jLabel13)
                            .addComponent(jLabel14)
                            .addComponent(jLabel16)
                            .addComponent(jLabel17))
                        .addGap(62, 62, 62))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(jLabel11)
                        .addGap(175, 175, 175)
                        .addComponent(jLabel12)
                        .addGap(83, 83, 83)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel13)
                            .addComponent(valor_titulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(47, 47, 47)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(data_compra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(2, 2, 2))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(68, 68, 68)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(41, 41, 41)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(data_vencimento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(56, 56, 56)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel17)
                    .addComponent(observacao_titulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(21, 21, 21)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btSalvarTit)
                    .addComponent(btLimparTitulo)
                    .addComponent(btSairTitulo))
                .addGap(37, 37, 37)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(20, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Cadastro Títulos", jPanel3);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>                        

    private void btTitulosCadastradosActionPerformed(java.awt.event.ActionEvent evt) {                                                     
        // TODO add your handling code here:
    }                                                    

    private void cidadePessoaFisicaActionPerformed(java.awt.event.ActionEvent evt) {                                                   
        // TODO add your handling code here:
    }                                                  

    private void btSalvarPessoaFisicaActionPerformed(java.awt.event.ActionEvent evt) {                                                     

      BD banco = new BD();
      banco.conecta();
      banco.inserir("INSERT INTO pessoafisica(nome, cpf, endereco, telefone, cidade) VALUES ('"+nomePessoaFisica.getText()+"','"+cpf.getText()+"','"+enderecoPessoaFisica.getText()+"','"+telefonePessoaFisica.getText()+"','"+cidadePessoaFisica.getText()+"')");
      banco.desconecta();
      nomePessoaFisica.setText(null);
      cpf.setText(null);
      enderecoPessoaFisica.setText(null);
      telefonePessoaFisica.setText(null);
      cidadePessoaFisica.setText(null);

    }                                                    

    private void SalvarPessoaJuridicaActionPerformed(java.awt.event.ActionEvent evt) {                                                     
      BD banco = new BD();
      banco.conecta();
      banco.inserir("INSERT INTO pessoajuridica(nome, cnpj, endereco, telefone, cidade) VALUES ('"+nomePessoaJuridica.getText()+"','"+Cnpj.getText()+"','"+enderecoPessoaJuridica.getText()+"','"+telefonePessoaJuridica.getText()+"','"+cidadePessoaJuridica.getText()+"')");
      banco.desconecta();
      nomePessoaJuridica.setText(null);
      Cnpj.setText(null);
      enderecoPessoaJuridica.setText(null);
      telefonePessoaJuridica.setText(null);
      cidadePessoaJuridica.setText(null);

    }                                                    

    private void btLimparActionPerformed(java.awt.event.ActionEvent evt) {                                         
      nomePessoaFisica.setText("");
      cpf.setText("");
      enderecoPessoaFisica.setText("");
      telefonePessoaFisica.setText("");
      cidadePessoaFisica.setText("");
    }                                        

    private void btSairActionPerformed(java.awt.event.ActionEvent evt) {                                       
        System.exit(0);
    }                                      

    private void btLimparpjActionPerformed(java.awt.event.ActionEvent evt) {                                           
      nomePessoaJuridica.setText("");
      Cnpj.setText("");
      enderecoPessoaJuridica.setText("");
      telefonePessoaJuridica.setText("");
      cidadePessoaJuridica.setText("");
    }                                          

    private void btSairpjActionPerformed(java.awt.event.ActionEvent evt) {                                         
        System.exit(0);
    }                                        

    private void btSalvarTitActionPerformed(java.awt.event.ActionEvent evt) {                                            
      BD banco = new BD();
      banco.conecta();
      banco.inserir("INSERT INTO titulos(valor, data_compra, data_vencimento, observacao) VALUES ('"+valor_titulo.getText()+"','"+data_compra.getText()+"','"+data_vencimento.getText()+"','"+observacao_titulo.getText()+"')");
      banco.desconecta();
      //clientesCadastrados.setSelectedItem();
      valor_titulo.setText(null);
      data_compra.setText(null);
      data_vencimento.setText(null);
      observacao_titulo.setText(null);
    }                                           

    private void btLimparTituloActionPerformed(java.awt.event.ActionEvent evt) {                                               
      valor_titulo.setText("");
      data_compra.setText("");
      data_vencimento.setText("");
      observacao_titulo.setText("");
    }                                              

    private void btSairTituloActionPerformed(java.awt.event.ActionEvent evt) {                                             
        System.exit(0);
    }                                            

    private void apagarActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        BD banco = new BD();
        int id_pessoafisica = Integer.parseInt(idPessoafisica.getText());
        banco.apagar(id_pessoafisica);
        nomePessoaFisica.setText(null);
        cpf.setText(null);
        enderecoPessoaFisica.setText(null);
        telefonePessoaFisica.setText(null);
        cidadePessoaFisica.setText(null);
    }                                      

    private void alterarActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        BD banco = new BD();
        int idpessoafisica = Integer.parseInt(idPessoafisica.getText());
        String Nome = nomePessoaFisica.getText();
        String CPF = cpf.getText();
        String Endereco = enderecoPessoaFisica.getText();
        String Telefone = telefonePessoaFisica.getText();
        String Cidade = cidadePessoaFisica.getText();
        banco.alterar(idpessoafisica, Nome, CPF,Endereco, Telefone, Cidade);
        nomePessoaFisica.setText(null);
        cpf.setText(null);
        enderecoPessoaFisica.setText(null);
        telefonePessoaFisica.setText(null);
        cidadePessoaFisica.setText(null);
        idPessoafisica.setText(null);
    }                                       

    private void buscarActionPerformed(java.awt.event.ActionEvent evt) {                                       
        BD banco = new BD();
        ResultSet res = null;
        int idpessoafisica = Integer.parseInt(idPessoafisica.getText());
        try {
        res = banco.recuperarDadosCliente(idpessoafisica);
        while (res.next()){
                nomePessoaFisica.setText(res.getString(2));
                cpf.setText(res.getString(3));
                enderecoPessoaFisica.setText(res.getString(4));
                telefonePessoaFisica.setText(res.getString(5));
                cidadePessoaFisica.setText(res.getString(6));
                idPessoafisica.setText(res.getString(1));
        }
        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }
        banco.desconecta();

    }                                      

    private void buscarpjActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        BD banco = new BD();
        ResultSet res = null;
        int idpj = Integer.parseInt(idpessoaj.getText());
        try {
        res = banco.recuperarDadosClientepj(idpj);
        while (res.next()){
                nomePessoaJuridica.setText(res.getString(2));
                Cnpj.setText(res.getString(3));
                enderecoPessoaJuridica.setText(res.getString(4));
                telefonePessoaJuridica.setText(res.getString(5));
                cidadePessoaJuridica.setText(res.getString(6));
                idpessoaj.setText(res.getString(1));
        }
        } catch (SQLException ex) {
            Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex);
        }
        banco.desconecta();

    }                                        

    private void alterarpjActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
        BD banco = new BD();
        int idpj = Integer.parseInt(idpessoaj.getText());
        String nomepj = nomePessoaJuridica.getText();
        String cnpj = Cnpj.getText();
        String enderecopj = enderecoPessoaJuridica.getText();
        String telefonepj = telefonePessoaJuridica.getText();
        String cidadepj = cidadePessoaJuridica.getText();
        banco.alterar(idpj, nomepj, cnpj,enderecopj, telefonepj, cidadepj);
        nomePessoaJuridica.setText(null);
        Cnpj.setText(null);
        enderecoPessoaJuridica.setText(null);
        telefonePessoaJuridica.setText(null);
        cidadePessoaJuridica.setText(null);
        idPessoafisica.setText(null);
    }                                         


    private void apagarpjActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        BD banco = new BD();
        int idpj = Integer.parseInt(idpessoaj.getText());
        banco.apagar(idpj);
        nomePessoaJuridica.setText(null);
        Cnpj.setText(null);
        enderecoPessoaJuridica.setText(null);
        telefonePessoaJuridica.setText(null);
        cidadePessoaJuridica.setText(null);
    }                                        

    private void buscartituloActionPerformed(java.awt.event.ActionEvent evt) {                                             
        // TODO add your handling code here:
    }                                            

    private void alterartituloActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
    }                                             

    private void apagartituloActionPerformed(java.awt.event.ActionEvent evt) {                                             
        // TODO add your handling code here:
    }                                            

    public void preencherTabela(String SQL){
           BD banco = new BD();
        ArrayList dados = new ArrayList();

        String [] Colunas = new String[]{
         "idpessoafisica", "nome", "cpf", "endereco","telefone","cidade"
        }; 

        conecta.executaSQL(SQL);
        try{ 
            conecta.res.first();
             do{
                 dados.add(new Object[]{conecta.res.getInt("idpessoafisica"),conecta.res.getString("nome"),conecta.res.getString("cpf"),conecta.res.getString("endereco"),conecta.res.getString("telefone"),conecta.res.getString("cidade"),});
             }while(conecta.rs.next());
        }catch (SQLException ex){
            JOptionPane.showMessageDialog(null, "Erro ao preencher o Arraylist");
        }
        ModetoTabela = new ModeloTabela(dados, Colunas);

    }

    }

    public static void main(String args[]) {
        /* Set the Nimbus look and feel */


        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Menu().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JTextField Cnpj;
    private javax.swing.JButton SalvarPessoaJuridica;
    private javax.swing.JButton alterar;
    private javax.swing.JButton alterarpj;
    private javax.swing.JButton alterartitulo;
    private javax.swing.JButton apagar;
    private javax.swing.JButton apagarpj;
    private javax.swing.JButton apagartitulo;
    private javax.swing.JButton btClientesCadastrados;
    private javax.swing.JButton btLimpar;
    private javax.swing.JButton btLimparTitulo;
    private javax.swing.JButton btLimparpj;
    private javax.swing.JButton btSair;
    private javax.swing.JButton btSairTitulo;
    private javax.swing.JButton btSairpj;
    private javax.swing.JButton btSalvarPessoaFisica;
    private javax.swing.JButton btSalvarTit;
    private javax.swing.JButton btTitulosCadastrados;
    private javax.swing.JButton buscar;
    private javax.swing.JButton buscarpj;
    private javax.swing.JButton buscartitulo;
    private javax.swing.JTextField cidadePessoaFisica;
    private javax.swing.JTextField cidadePessoaJuridica;
    private javax.swing.JTextField cpf;
    private javax.swing.JTextField data_compra;
    private javax.swing.JTextField data_vencimento;
    private javax.swing.JTextField enderecoPessoaFisica;
    private javax.swing.JTextField enderecoPessoaJuridica;
    private javax.swing.JTextField idPessoafisica;
    private javax.swing.JTextField idpessoaj;
    private javax.swing.JTextField idtitulos;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField nomePessoaFisica;
    private javax.swing.JTextField nomePessoaJuridica;
    private javax.swing.JTextField observacao_titulo;
    private javax.swing.JTable tbclientes;
    private javax.swing.JTable tbclientes1;
    private javax.swing.JTextField telefonePessoaFisica;
    private javax.swing.JTextField telefonePessoaJuridica;
    private javax.swing.JTextField valor_titulo;
    // End of variables declaration                   
}




classe da tabela


import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Renata
 */
public class Tabela extends AbstractTableModel {

    private ArrayList linhas = null;
    private String[] colunas = null;

    public Tabela(ArrayList lin, String [] col){
        setLinhas(lin);
        setColunas(col);

    }
    public ArrayList getLinhas(){
        return linhas;
    }
    public void setLinhas(ArrayList dados){
        linhas=dados;
    }
    public String [] getColunas(){
        return colunas;
    }
    public void setColunas(String [] nomes){
        colunas = nomes;    
    }
    public int getColumnCount(){
        return colunas.length;
    }
    public int getRowCount(){
        return linhas.size();
    }
    public String getColumnName(int numCol){
        return colunas[numCol];
    }
    public Object getValueAt(int numLin, int numCol){
        Object[] linha = (Object[])getLinhas().get(numLin);
        return linha[numCol];
    }

}

https://www.filepicker.io/api/file/ZKy5HOTtBSIpAvcNpsgY

Versão(1):

Ver a versão formatada

Dificuldade em fazer uma ArrayList,

Comentário

new question