olá pessoal sou um novo programador em java, estou utilizando um banco de dados hsqldb standalone na minha aplicação, porem quando pesso para executar ele gera o seguinte erro:
Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
SE alguem puder encontrar o erro, e ficarei muito grato.
esse é minha classe para conexão:
package br.com.integrator.cap11.agenda;
import java.sql.*;
/**
*
-
@author rodrigo
*/
public class Conexao {
private Connection con;/** Creates a new instance of Conexao */
public Conexao() {try{ Class.forName("org.hsqldb.jdbcDriver"); con = DriverManager.getConnection("jdbc:hsqldb:file:/db/agenda", "sa", ""); } catch(Exception e){ System.out.println("Falha na Conexão!"); e.printStackTrace(); }
}
public Connection getConexao(){
return con;
}
public void fechar(ResultSet rs){
if(rs != null){
try{
rs.close();
}
catch(Exception e){}
}
}
public void fechar(java.sql.Statement stmt){
if (stmt != null){
try{
stmt.close();
}
catch(Exception e){}
}
}
public void fecharConexao(){
if (con != null){
try{
con.close();
}
catch(Exception e){}
}
}
}
e essa é minha classe que gera a tabela:
package br.com.integrator.cap11.agenda;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;
/**
*
-
@author Rodrigo
*/
public class TabelaAgenda extends AbstractTableModel {
private int rownum;private static final String[] colNames={“registro”,“nome”,“telefone”, “cidade”};
private ArrayList<String[]> ResultSets;
/** Creates a new instance of TabelaAgenda */
public TabelaAgenda(ResultSet rs) throws SQLException {
setResult(rs);
}
public Object getValueAt(int rowIndex, int columnIndex){
String[] row=ResultSets.get(rowIndex);
return row[columnIndex];
}
public int getRowCount(){
return ResultSets.size();
}
public int getColumnCount(){
return colNames.length;
}
public String getColumnName(int param){
return colNames[param];
}
public void setResult(ResultSet rs) throws SQLException {ResultSets=new ArrayList<String[]>();
while (rs.next()){ //o problema ocorre bem aqui segundo netbeans
String[] row={
rs.getString(1),
rs.getString(2),
rs.getString(8),
rs.getString(5)
};
ResultSets.add(row);
}
fireTableStructureChanged();
}
public void deleteRow(int row){
ResultSets.remove(row);
fireTableRowsDeleted(row,row);
}
}
essa é minha classe principal:
package br.com.integrator.cap11.agenda;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
/**
*
-
@author Rodrigo
*/
public class Agenda extends javax.swing.JFrame {/** Creates new form Agenda */
public Agenda() throws SQLException {
conexao = new Conexao();
conn = conexao.getConexao();
stmt = conn.createStatement();
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.
*/
// <editor-fold defaultstate=“collapsed” desc=" Código Gerado ">
private void initComponents() throws SQLException {jToolBar1 = new javax.swing.JToolBar();
btSalvar = new javax.swing.JButton();
btNovo = new javax.swing.JButton();
btExcluir = new javax.swing.JButton();
JTabbedPane1 = new javax.swing.JTabbedPane();
panelAgenda = new javax.swing.JPanel();
jTable1 = new javax.swing.JTable();
panelDados = new javax.swing.JPanel();
lNome = new javax.swing.JLabel();
lEndereco = new javax.swing.JLabel();
lBairro = new javax.swing.JLabel();
lCidade = new javax.swing.JLabel();
lEstado = new javax.swing.JLabel();
tfNome = new javax.swing.JTextField();
tfEndereco = new javax.swing.JTextField();
tfBairro = new javax.swing.JTextField();
tfCidade = new javax.swing.JTextField();
lCep = new javax.swing.JLabel();
lTelefone = new javax.swing.JLabel();
javax.swing.text.MaskFormatter maskestado = null;
try{
maskestado = new javax.swing.text.MaskFormatter(“UU”);
maskestado.setPlaceholderCharacter(’’);
}
catch(java.text.ParseException exc){}
tfEstado = new javax.swing.JFormattedTextField(maskestado);
javax.swing.text.MaskFormatter maskcep = null;
try{
maskcep = new javax.swing.text.MaskFormatter("#####-###");
maskcep.setPlaceholderCharacter(’’);
}
catch(java.text.ParseException exc){}
tfCep = new javax.swing.JFormattedTextField(maskcep);
javax.swing.text.MaskFormatter masktel = null;
try{
masktel = new javax.swing.text.MaskFormatter("(##)####-####");
masktel.setPlaceholderCharacter(’_’);
}
catch(java.text.ParseException exc){}
tfTelefone = new javax.swing.JFormattedTextField(masktel);
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JSeparator();
jMenuItem3 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem4 = new javax.swing.JMenuItem();setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});btSalvar.setIcon(new javax.swing.ImageIcon(“C:\Documents and Settings\Rodrigo\Meus documentos\java\NetBeans\Projeto Agenda\ProjAgenda\toolbar\save.gif”));
btSalvar.setToolTipText(“Salvar”);
btSalvar.setName(“btSalvar”);
btSalvar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btSalvarActionPerformed(evt);
}
});jToolBar1.add(btSalvar);
btNovo.setIcon(new javax.swing.ImageIcon(“C:\Documents and Settings\Rodrigo\Meus documentos\java\NetBeans\Projeto Agenda\ProjAgenda\toolbar\actionEdit.gif”));
btNovo.setToolTipText(“Novo”);
btNovo.setName(“btNovo”);
btNovo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btNovoActionPerformed(evt);
}
});jToolBar1.add(btNovo);
jToolBar1.addSeparator();
btExcluir.setIcon(new javax.swing.ImageIcon(“C:\Documents and Settings\Rodrigo\Meus documentos\java\NetBeans\Projeto Agenda\ProjAgenda\toolbar\actionCancel.gif”));
btExcluir.setToolTipText(“Excluir”);
btExcluir.setEnabled(false);
btExcluir.setName(“btExcluir”);
btExcluir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btExcluirActionPerformed(evt);
}
});
btExcluir.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btExcluirMouseClicked(evt);
}
});jToolBar1.add(btExcluir);
JTabbedPane1.setToolTipText("");
tabela = new TabelaAgenda (getResults());
jTable1.setModel(tabela);
jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable1MouseClicked(evt);
}
});org.jdesktop.layout.GroupLayout panelAgendaLayout = new org.jdesktop.layout.GroupLayout(panelAgenda);
panelAgenda.setLayout(panelAgendaLayout);
panelAgendaLayout.setHorizontalGroup(
panelAgendaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jTable1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
);
panelAgendaLayout.setVerticalGroup(
panelAgendaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jTable1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
);
JTabbedPane1.addTab(“Agenda”, panelAgenda);lNome.setText(“Nome:”);
lEndereco.setText(“Endere\u00e7o:”);
lBairro.setText(“Bairro:”);
lCidade.setText(“Cidade:”);
lEstado.setText(“Estado”);
tfNome.setText(“jTextField1”);
tfEndereco.setText(“jTextField2”);
tfBairro.setText(“jTextField3”);
tfCidade.setText(“jTextField4”);
lCep.setText(“CEP:”);
lTelefone.setText(“Telefone:”);
tfEstado.setText(“jj”);
tfEstado.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tfEstadoActionPerformed(evt);
}
});tfCep.setText(“jFormattedTextField2”);
tfCep.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tfCepActionPerformed(evt);
}
});tfTelefone.setText(“jFormattedTextField3”);
org.jdesktop.layout.GroupLayout panelDadosLayout = new org.jdesktop.layout.GroupLayout(panelDados);
panelDados.setLayout(panelDadosLayout);
panelDadosLayout.setHorizontalGroup(
panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(panelDadosLayout.createSequentialGroup()
.addContainerGap()
.add(panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(panelDadosLayout.createSequentialGroup()
.add(16, 16, 16)
.add(lNome)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(tfNome, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE))
.add(panelDadosLayout.createSequentialGroup()
.add(lEndereco)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(tfEndereco, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE))
.add(panelDadosLayout.createSequentialGroup()
.add(13, 13, 13)
.add(panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(lEstado)
.add(lBairro))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(panelDadosLayout.createSequentialGroup()
.add(tfEstado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(lCep)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(tfCep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 76, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(tfBairro, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 142, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(panelDadosLayout.createSequentialGroup()
.add(13, 13, 13)
.add(lCidade)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(tfCidade, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE))
.add(panelDadosLayout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(lTelefone)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(tfTelefone, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
.add(13, 13, 13))
);
panelDadosLayout.setVerticalGroup(
panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(panelDadosLayout.createSequentialGroup()
.add(34, 34, 34)
.add(panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(lNome)
.add(tfNome, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(22, 22, 22)
.add(panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(lEndereco)
.add(tfEndereco, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(18, 18, 18)
.add(panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(lBairro)
.add(lCidade)
.add(tfCidade, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(tfBairro, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(22, 22, 22)
.add(panelDadosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(lEstado)
.add(tfEstado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(lCep)
.add(tfCep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(lTelefone)
.add(tfTelefone, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addContainerGap(28, Short.MAX_VALUE))
);
JTabbedPane1.addTab(“Dados”, panelDados);jMenu1.setMnemonic(‘A’);
jMenu1.setText(“Arquivo”);
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem1.setText(“Novo”);
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});jMenu1.add(jMenuItem1);
jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem2.setText(“Salvar”);
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});jMenu1.add(jMenuItem2);
jMenu1.add(jSeparator1);
jMenuItem3.setText(“Sair”);
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});jMenu1.add(jMenuItem3);
jMenuBar1.add(jMenu1);
jMenu2.setMnemonic(‘u’);
jMenu2.setText(“Ajuda”);
jMenuItem4.setText(“Sobre”);
jMenu2.add(jMenuItem4);jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.add(JTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(JTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void formWindowOpened(java.awt.event.WindowEvent evt) {
// TODO adicione seu código de manipulação aqui:
desCampos();
}private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO adicione seu código de manipulação aqui:
System.exit(0);
}private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO adicione seu código de manipulação aqui:
if(novo)
insRegistros();
else
atRegistros();
desCampos();
btExcluir.setEnabled(false);
}private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO adicione seu código de manipulação aqui:
novo = true;
JTabbedPane1.setSelectedIndex(1);;
limpar();
habCampos();
btExcluir.setEnabled(false);
}private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {
// TODO adicione seu código de manipulação aqui:
if(novo)
insRegistros();
else
atRegistros();
desCampos();
btExcluir.setEnabled(false);
}private void btNovoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO adicione seu código de manipulação aqui:
novo = true;
JTabbedPane1.setSelectedIndex(1);
limpar();
habCampos();
btExcluir.setEnabled(false);
}private void btExcluirActionPerformed(java.awt.event.ActionEvent evt) {
try {
// TODO adicione seu código de manipulação aqui:
excluir(rowId);
} catch (SQLException ex) {
ex.printStackTrace();
}
}private void btExcluirMouseClicked(java.awt.event.MouseEvent evt) {
// TODO adicione seu código de manipulação aqui:}
private void tfCepActionPerformed(java.awt.event.ActionEvent evt) {
// TODO adicione seu código de manipulação aqui:
}private void tfEstadoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO adicione seu código de manipulação aqui:
}private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {
// TODO adicione seu código de manipulação aqui:btExcluir.setEnabled(true); rowId = (String) tabela.getValueAt(jTable1.getSelectedRow(),0); if(evt.getClickCount()==2){ JTabbedPane1.setSelectedIndex(1); visRegistro(rowId); habCampos(); }
}
/**
-
@param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
new Agenda().setVisible(true);
} catch (SQLException ex) {
ex.printStackTrace();
}
}
});
}
private ResultSet getResults() {
ResultSet rs=null;
try{
rs=stmt.executeQuery(“Select * from registros”);
}
catch(SQLException e){}
return rs;
}private void visRegistro(String value) {
JTextField[] tf = campos();
String SQL = “Select * from registros where registro=’”+value+"’";
ResultSet res;
try{
res = stmt.executeQuery(SQL);
res.next();
for (int i=0; i<tf.length; i++)
tf[i].setText(res.getString(i+2));
}
catch(SQLException ex){
ex.printStackTrace();
}
}private JTextField[] campos() {
JTextField[] tf = {tfNome, tfEndereco, tfBairro, tfCidade, tfEstado, tfCep, tfTelefone};
return tf;
}private void habCampos() {
JTextField[] tf = campos();
for(int i=0; i><tf.length;i++)
tf[i].setEnabled(true);
}private void desCampos(){
JTextField[] tf = campos();
for(int i=0; i><tf.length;i++)
tf[i].setEnabled(false);
}private void delRegistro(String value) throws SQLException{
String SQL=“Delete from registros where registro=”+value;
stmt.executeUpdate(SQL);
}private void excluir(String valor)throws SQLException{
int opcao=JOptionPane.showConfirmDialog(this,“Tem certeza que você deseja excluir esse Cadastro?”,“Exclusão Cadastro”,JOptionPane.YES_NO_OPTION);
if (opcao==JOptionPane.YES_OPTION){
delRegistro(valor);
tabela.deleteRow(jTable1.getSelectedRow());
btExcluir.setEnabled(false);
JTabbedPane1.setSelectedIndex(0);
limpar();
}
}private void insRegistros (){
try{
String SQL=“Insert into registros values(?,?,?,?,?,?,?,?);”;
PreparedStatement ps=conn.prepareStatement(SQL);
ps.setInt(1, criarRegistro());
ps.setString(2,tfNome.getText());
ps.setString(3,tfEndereco.getText());
ps.setString(4,tfBairro.getText());
ps.setString(5,tfCidade.getText());
ps.setString(6,tfEstado.getText());
ps.setString(7,tfCep.getText());
ps.setString(8,tfTelefone.getText());
ps.executeUpdate();
limpar();
tabela.setResult(getResults());
ps.close();
JTabbedPane1.setSelectedIndex(0);
novo = false;
}
catch(SQLException ex){
ex.printStackTrace();
}
}private void atRegistros(){
JTextField[] tf = campos();
int opcao = JOptionPane.showConfirmDialog(this,“Deseja salvar as alterações desse cadastro?”,“Alteração de Cadastro”, JOptionPane.YES_NO_OPTION);
if (opcao==JOptionPane.YES_OPTION){
try{
String SQL="Update registros set " + “nome=?, endereco=?, bairro=?, cidade=?,” + “estado=?, cep=?, telefone=?” + “where registro=?”;
PreparedStatement ps = conn.prepareStatement(SQL);
for(int i=0;i<tf.length;i++)
ps.setString(i+1, tf[i].getText());
ps.setString(8,rowId);
ps.executeUpdate();
limpar();
tabela.setResult(getResults());
ps.close();
JTabbedPane1.setSelectedIndex(0);
}
catch(SQLException ex){
ex.printStackTrace();
}
}
}private void limpar() {
JTextField[] tf = campos();
for(int i=0;i<tf.length;i++)
tf[i].setText("");
}private int criarRegistro() {
String SQL = "Select * from registros"; ResultSet res; try{ res = stmt.executeQuery(SQL); res.last(); lastId = res.getString(1); intLastId = Integer.parseInt(lastId) + 1; } catch(SQLException ex){ ex.printStackTrace(); } return intLastId;
}
// Declaração de variáveis - não modifique
private javax.swing.JTabbedPane JTabbedPane1;
private javax.swing.JButton btExcluir;
private javax.swing.JButton btNovo;
private javax.swing.JButton btSalvar;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTable jTable1;
private javax.swing.JToolBar jToolBar1;
private javax.swing.JLabel lBairro;
private javax.swing.JLabel lCep;
private javax.swing.JLabel lCidade;
private javax.swing.JLabel lEndereco;
private javax.swing.JLabel lEstado;
private javax.swing.JLabel lNome;
private javax.swing.JLabel lTelefone;
private javax.swing.JPanel panelAgenda;
private javax.swing.JPanel panelDados;
private javax.swing.JTextField tfBairro;
private javax.swing.JFormattedTextField tfCep;
private javax.swing.JTextField tfCidade;
private javax.swing.JTextField tfEndereco;
private javax.swing.JTextField tfNome;
private javax.swing.JFormattedTextField tfTelefone;
// Fim da declaração de variáveis
private javax.swing.JFormattedTextField tfEstado;
private TabelaAgenda tabela;
private Conexao conexao;
private Statement stmt;
private Connection conn;private String rowId;
private boolean novo;
private String lastId;
private int intLastId;
-
}>