Uma ajuda? ficarei grato

[code]import java.sql.;
import javax.swing.
;
import java.awt.;
import java.awt.event.
;

class Suporte1 extends JFrame implements ActionListener
{
JLabel label1,label2,label3,label4,label5,label6;
JButton btGravar,btAlterar,btExcluir,btNovo,btLocalizar,btCancelar;
static JTextField tfChamado,tfData,tfHora,tfSolicitante,tfDepartamento,tfFone;
JPanel painel1 = new JPanel();
ResultSet resultSet;
Statement statement;

public static void main(String args[])
{
    JFrame janela = new Suporte1();
    janela.setUndecorated(true);
    janela.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
    janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    janela.setVisible(true);
}
Suporte1()
{
    painel1.setLayout(new FlowLayout(FlowLayout.LEFT));
    label1 = new JLabel("Chamado");
    label2 = new JLabel("Data");
    label3 = new JLabel("Hora");
    label4 = new JLabel("Solicitante");
    label5 = new JLabel("Departamento");
    label6 = new JLabel("Fone");
    tfChamado = new JTextField(10);
    tfChamado.addActionListener(this);
    tfData = new JTextField(8);
    tfHora = new JTextField(8);
    tfSolicitante = new JTextField(20);
    btGravar =new JButton("Gravar");
    btAlterar =new JButton("Alterar");
    btExcluir =new JButton("Excluir");
    btLocalizar =new JButton("Localizar");
    btNovo =new JButton("Novo");
    btCancelar =new JButton("Cancelar");
    btGravar.setBackground(new Color(180,180,250));
    btAlterar.setBackground(new Color(180,180,250));
    btExcluir.setBackground(new Color(180,180,250));
    btLocalizar.setBackground(new Color(180,180,250));
    btNovo.setBackground(new Color(180,180,250));
    btCancelar.setBackground(new Color(180,180,250));
    btGravar.addActionListener(this);
    btAlterar.addActionListener(this);
    btExcluir.addActionListener(this);
    btLocalizar.addActionListener(this);
    btNovo.addActionListener(this);
    btCancelar.addActionListener(this);
    painel1.add(label1);          painel1.add(tfChamado);              
    painel1.add(label2);          painel1.add(tfData); 
    painel1.add(label3);          painel1.add(tfHora); 
    painel1.add(label4);          painel1.add(tfSolicitante); 
    painel1.add(label5);          painel1.add(tfDepartamento);
    painel1.add(tfFone);          painel1.add(label6);
    painel1.add(btNovo);          painel1.add(btLocalizar); 
    painel1.add(btGravar);        painel1.add(btAlterar); 
    painel1.add(btExcluir);       painel1.add(btCancelar); 
    getContentPane().add(painel1);
    setTitle("Cadastramento do suporte");
    setSize(700,200);
    setResizable(false);
    setBotoes(true,true,false,false,false,false);
    carregaResultSet();
    
}


public void actionPerformed(ActionEvent e)
{
    if (e.getSource()==btNovo)
    {
        limpaCampos();
        setBotoes(false,false,true,false,false,true);
        return;
    }
    if (e.getSource()==btCancelar)
    {
        limpaCampos();
        setBotoes(true,true,false,false,false,false);
        return;
    }
    
    if (e.getSource()==btGravar)
        // gravar um registro novo
    {
        try
        {
            String sql = "INSERT INTO Chamados (chamado,data,hora," + "solicitante,departamento,fone) Values('"+
                    tfChamado.getText() + "','" +
                    tfData.getText() + "','" +
                    tfHora.getText() + "','" +
                    tfSolicitante.getText() + "','" +
                    tfDepartamento.getText() + "','" +
                    tfFone.getText() + "','" + "')";
                    statement.executeUpdate(sql);
                    JOptionPane.showMessageDialog(null,"gravação realizada com sucesso");
                    setBotoes(true,true,false,true,true,false);
                    
        }
        catch (SQLException erro)
        {
            if (erro.getMessage().equals("General error"))
                JOptionPane.showMessageDialog(null,"Filme já cadastrado");
            else
                JOptionPane.showMessageDialog(null,"Data inválida");
        }
        carregaResultSet();
        return;//put
    }

//----------------------final da inclusão----------------------------

      if (e.getSource()==btAlterar)
          // altera um registro
      {
        try
        {
            String sql = "UPDATE Chamados SET " +
                    "chamado='" + tfChamado.getText() + "'," +
                    "data='" + tfData.getText() + "'," +
                    "hora='" + tfHora.getText() + "'," +
                    "solicitante='" + tfSolicitante.getText() + "'," +
                    "departamento='" + tfDepartamento.getText() + "'," +
                    "fone='" + tfFone.getText() + "'" +
                    "WHERE chamado ='" + tfChamado.getText()+ "'";
                    int r = statement.executeUpdate(sql);
                    if (r==1)
                        JOptionPane.showMessageDialog(null,"Alteração realizada com sucesso");
                    else
                        JOptionPane.showMessageDialog(null,"problemas na alteração");
                        
                    setBotoes(true,true,false,true,true,false);
                    
        }
                  catch (SQLException erro)
                   {
                       JOptionPane.showMessageDialog(null,"Data inválida");
                   }
                     carregaResultSet();
                     return;//put
      }
        

//---------------------------final da alteração-----------------------------------
    if (e.getSource()==btExcluir)
    {
        try
        {
            String sql = "SELECT chamado,data, hora FROM Chamados Where chamado = '"+tfChamado.getText()+"'";
            resultSet = statement.executeQuery(sql);
            String nome = "";
            try
            {
                resultSet.next();
                nome = "deletar o chamado: "+ resultSet.getString("hora");
            }
            catch (SQLException ex1)
            {
                JOptionPane.showMessageDialog(null,"chamado não cadastrado");
                carregaResultSet();
                return;
            }
            int n = JOptionPane.showConfirmDialog(null,nome," ",JOptionPane.YES_NO_OPTION);
            if (n==JOptionPane.YES_OPTION)
            {
                sql = "DELETE FROM Chamados Where chamado = '" + tfChamado.getText()+"'";
                int r = statement.executeUpdate(sql);
                if (r==1)
                    JOptionPane.showMessageDialog(null,"Exclusão realizada com sucesso");
                else
                    JOptionPane.showMessageDialog(null,"Não foi possível excluir o chamado");
                    limpaCampos();
                    setBotoes(true,true,false,false,false,false);
            }
        }
        catch (SQLException erro){}
        carregaResultSet();
        
    }
        //----------------------------final da exclusão----------------------------------------
                 
        if (e.getSource()==btLocalizar || e.getSource()==tfChamado)
        {
            try
            {
                String sql = "SELECT * FROM Chamados Where chamado = '"+ tfChamado.getText()+"'";
                resultSet = statement.executeQuery(sql);
                resultSet.next();
                atualizaCampos();
                setBotoes(true,true,false,true,true,false);
                    
            }
            catch (SQLException erro)
            {
                JOptionPane.showMessageDialog(null,"Chamado não encontrado");
                carregaResultSet();
                return;
            }
            
        }
     //---------------------final da localização----------------------------------------------
           
    }
    public void carregaResultSet()
    {
        String url = "jdbc:odbc:MeuSuporte";
        try
        {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection minhaConexao = DriverManager.getConnection(url);
            statement = minhaConexao.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
            resultSet = statement.executeQuery("SELECT * FROM Chamados");
        }
        catch (ClassNotFoundException erro)
        {
            System.out.println("Driver JDBC-ODBC não encontrado");
        }
        catch (SQLException erro)
        {
            System.out.println("Problemas na conexao com a fonte de dados");
            
        }
        catch(NullPointerException e){   
 e.printStackTrace();   
        }        
    }
    
    public static void limpaCampos()
    {
        tfChamado.setText("");
        tfData.setText("");
        tfHora.setText("");
        tfSolicitante.setText("");
        tfDepartamento.setText("");
        tfFone.setText("");
    }
    
    public void atualizaCampos()
    {
        try
        {
            tfChamado.setText(resultSet.getString("chamado"));
            tfData.setText(""+resultSet.getDate("data"));
            tfHora.setText(resultSet.getString("hora"));
            tfSolicitante.setText(resultSet.getString("solicitante"));
            tfDepartamento.setText(resultSet.getString("departamento"));
            tfFone.setText(resultSet.getString("fone"));
        }
        catch (SQLException erro){}
    }
    
    public void setBotoes(boolean bNovo,boolean bLocalizar,boolean bGravar,boolean bAlterar,boolean bExcluir,boolean bCancelar)
                {
                  btNovo.setEnabled(bNovo);
                  btLocalizar.setEnabled(bLocalizar);
                  btGravar.setEnabled(bGravar);
                  btAlterar.setEnabled(bAlterar);
                  btExcluir.setEnabled(bExcluir);
                  btCancelar.setEnabled(bCancelar);
                }
    }

[code][list]

// dá esse pau: Exception in thread “main” java.lang.NullPointerException
at java.awt.Container.addImpl(Container.java:1031)
at java.awt.Container.add(Container.java:352)
at Suporte1.(Main.java:59)
at Suporte1.main(Main.java:17)
Java Result: 1[/code]

[quote]_deu esse msm pau ,eu coloquei catch(NullPointerException e){   
 e.printStackTrace();   
        }        

mas não tá funcionando, esse é o meu primeiro sistema, eu li java2 e java como programar,vou começar um curso logo,mas precisava pelo menos rodar esse, se alguém me pudesse ajudar,

_me mostrar como estruturar esse programa para ficar legível. [/quote]

Cara. Na linha 59 no Construtor de Suporte1…
Vc deve está tentando acessar a referência de um objeto que não foi instanciado.
Assim não dá para saber qual a linnha 59, mas no seu editor é fácil.

Sempre que for colar um código aqui no GUJ usa as tags code “[ code ][ /code ]”

Fica mais fácil a visualização.

Faltou:

tfDepartamento = new JTextField();
tfFone = new JTextField();

rodou,mas quando eu insiro a data , fala data inválida , eu coloquei máscara de entrada no access , no java eu tenho que colocar algum objeto que converta a entrada data para salvar no BD? ou alguma pattern?

[quote]_ ta rodando blz, mas só o botão gravar não rola, ele cae no sql exception erro, data inválida?
_comom eu arrumo isso? e tem algum tutorial incinando a deixar o prog. à prova de falhas à entradas?[/quote]

import java.sql.*;
import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;




class Suporte1 extends JFrame implements ActionListener
{
    JLabel label1,label2,label3,label4,label5,label6;
    JButton btGravar,btAlterar,btExcluir,btNovo,btLocalizar,btCancelar;
    static JTextField tfChamado,tfData,tfHora,tfSolicitante,tfDepartamento,tfFone;
    JPanel painel1 = new JPanel();
    ResultSet resultSet;
    Statement statement;
    
    public static void main(String args[]) 
    {
        
        JFrame janela = new Suporte1();
        janela.setUndecorated(true);
        janela.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
        janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        janela.setVisible(true); 
        
        
    }
    Suporte1() 
    {
        
        painel1.setLayout(new FlowLayout(FlowLayout.LEFT));
        label1 = new JLabel("Chamado");
        label2 = new JLabel("Data");
        label3 = new JLabel("Hora");
        label4 = new JLabel("Solicitante");
        label5 = new JLabel("Depart.");
        label6 = new JLabel("Fone");
        tfChamado = new JTextField(4);
        tfChamado.addActionListener(this);
        tfData = new JTextField(6);
        tfHora = new JTextField(4);
        tfSolicitante = new JTextField(10);
        tfDepartamento = new JTextField(10);   
        tfFone = new JTextField(8); 
        btGravar =new JButton("Gravar");
        btAlterar =new JButton("Alterar");
        btExcluir =new JButton("Excluir");
        btLocalizar =new JButton("Localizar");
        btNovo =new JButton("Novo");
        btCancelar =new JButton("Cancelar");
        btGravar.setBackground(new Color(180,180,250));
        btAlterar.setBackground(new Color(180,180,250));
        btExcluir.setBackground(new Color(180,180,250));
        btLocalizar.setBackground(new Color(180,180,250));
        btNovo.setBackground(new Color(180,180,250));
        btCancelar.setBackground(new Color(180,180,250));
        btGravar.addActionListener(this);
        btAlterar.addActionListener(this);
        btExcluir.addActionListener(this);
        btLocalizar.addActionListener(this);
        btNovo.addActionListener(this);
        btCancelar.addActionListener(this);
        painel1.add(label1);          painel1.add(tfChamado);              
        painel1.add(label2);          painel1.add(tfData); 
        painel1.add(label3);          painel1.add(tfHora); 
        painel1.add(label4);          painel1.add(tfSolicitante); 
        painel1.add(label5);          painel1.add(tfDepartamento);
        painel1.add(label6);          painel1.add(tfFone);
        painel1.add(btNovo);          painel1.add(btLocalizar); 
        painel1.add(btGravar);        painel1.add(btAlterar); 
        painel1.add(btExcluir);       painel1.add(btCancelar); 
        getContentPane().add(painel1);
        setTitle("Cadastramento do suporte");
        setSize(850,100);
        setResizable(false);
        setBotoes(true,true,false,false,false,false);
        carregaResultSet();
        
        
    }
    
    
    public void actionPerformed(ActionEvent e)
    {
      
        if (e.getSource()==btNovo)
        {
            limpaCampos();
            setBotoes(false,false,true,false,false,true);
            return;
        }
        if (e.getSource()==btCancelar)
        {
            limpaCampos();
            setBotoes(true,true,false,false,false,false);
            return;
        }
        
        if (e.getSource()==btGravar)
            // gravar um registro novo
        {
            try
            {
                       
                
                        
                        String dataStr = tfData.getText(); //aqui vc pega a data q o cara digitou e joga numa variável...     
                        SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");       
        
                        String sql = ("INSERT INTO Chamados (chamado,data,hora," + "solicitante,departamento,fone) VALUES('"+
                        tfChamado.getText() + "," +        
                        new Date(df.parse(dataStr).getTime()) + "," +
                        tfHora.getText() + "," +
                        tfSolicitante.getText() + "," +
                        tfDepartamento.getText() + "," +
                        tfFone.getText() + "')"); 
                        statement.executeUpdate(sql);                        
                        JOptionPane.showMessageDialog(null,"gravação realizada com sucesso");
                        setBotoes(true,true,false,true,true,false);
                        
            }
            catch (SQLException erro)
            {
                if (erro.getMessage().equals("General error"))
                    JOptionPane.showMessageDialog(null,"chamado já cadastrado");
                else
                    JOptionPane.showMessageDialog(null,"Data inválida");
            }
            carregaResultSet();
            
        }
  //----------------------final da inclusão----------------------------
                
          if (e.getSource()==btAlterar)
              // altera um registro
          {
            try
            {
                String sql = "UPDATE Chamados SET " +
                        "chamado='" + tfChamado.getText() + "'," +
                        "data='" + tfData.getText() + "'," +
                        "hora='" + tfHora.getText() + "'," +
                        "solicitante='" + tfSolicitante.getText() + "'," +
                        "departamento='" + tfDepartamento.getText() + "'," +
                        "fone='" + tfFone.getText() + "'" +
                        "WHERE chamado ='" + tfChamado.getText()+ "'";
                        int r = statement.executeUpdate(sql);
                        if (r==1)
                            JOptionPane.showMessageDialog(null,"Alteração realizada com sucesso");
                        else
                            JOptionPane.showMessageDialog(null,"problemas na alteração");
                            
                        setBotoes(true,true,false,true,true,false);
                        
            }
                      catch (SQLException erro)
                       {
                           JOptionPane.showMessageDialog(null,"Data inválida");
                       }
                         carregaResultSet();
                         
          }
            
    
    //---------------------------final da alteração-----------------------------------
        if (e.getSource()==btExcluir)
        {
            try
            {
                String sql = "SELECT chamado,data, hora FROM Chamados Where chamado = '"+tfChamado.getText()+"'";
                resultSet = statement.executeQuery(sql);
                String nome = "";
                try
                {
                    resultSet.next();
                    nome = "deletar o chamado: "+ resultSet.getString("chamado");
                }
                catch (SQLException ex1)
                {
                    JOptionPane.showMessageDialog(null,"chamado não cadastrado");
                    carregaResultSet();
                    return;
                }
                int n = JOptionPane.showConfirmDialog(null,nome," ",JOptionPane.YES_NO_OPTION);
                if (n==JOptionPane.YES_OPTION)
                {
                    sql = "DELETE FROM Chamados Where chamado = '" + tfChamado.getText()+"'";
                    int r = statement.executeUpdate(sql);
                    if (r==1)
                        JOptionPane.showMessageDialog(null,"Exclusão realizada com sucesso");
                    else
                        JOptionPane.showMessageDialog(null,"Não foi possível excluir o chamado");
                        limpaCampos();
                        setBotoes(true,true,false,false,false,false);
                }
            }
            catch (SQLException erro){}
            carregaResultSet();
            
        }
            //----------------------------final da exclusão----------------------------------------
                     
            if (e.getSource()==btLocalizar || e.getSource()==tfChamado)
            {
                try
                {
                    String sql = "SELECT * FROM Chamados Where chamado = '"+ tfChamado.getText()+"'";
                    resultSet = statement.executeQuery(sql);
                    resultSet.next();
                    atualizaCampos();
                    setBotoes(true,true,false,true,true,false);
                        
                }
                catch (SQLException erro)
                {
                    JOptionPane.showMessageDialog(null,"Chamado não encontrado");
                    carregaResultSet();
                    return;
                }
                
            }
         //---------------------final da localização----------------------------------------------
               
        }
        public void carregaResultSet()
        {
            String url = "jdbc:odbc:MeuSuporte";
            try
            {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection minhaConexao = DriverManager.getConnection(url);
                statement = minhaConexao.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
                resultSet = statement.executeQuery("SELECT * FROM Chamados");
            }
            catch (ClassNotFoundException erro)
            {
                System.out.println("Driver JDBC-ODBC não encontrado");
            }
            catch (SQLException erro)
            {
                System.out.println("Problemas na conexao com a fonte de dados");
                
            }
            catch(NullPointerException e){   
     e.printStackTrace();   
            }        
        }
        
        public static void limpaCampos()
        {
            tfChamado.setText("");
            tfData.setText("");
            tfHora.setText("");
            tfSolicitante.setText("");
            tfDepartamento.setText("");
            tfFone.setText("");
        }
        
        public void atualizaCampos()
        {
            try
            {
                tfChamado.setText(resultSet.getString("chamado"));
                tfData.setText(""+resultSet.getDate("data"));
                tfHora.setText(resultSet.getString("hora"));
                tfSolicitante.setText(resultSet.getString("solicitante"));
                tfDepartamento.setText(resultSet.getString("departamento"));
                tfFone.setText(resultSet.getString("fone"));
            }
            catch (SQLException erro){}
        }
        
        public void setBotoes(boolean bNovo,boolean bLocalizar,boolean bGravar,boolean bAlterar,boolean bExcluir,boolean bCancelar)
                    {
                      btNovo.setEnabled(bNovo);
                      btLocalizar.setEnabled(bLocalizar);
                      btGravar.setEnabled(bGravar);
                      btAlterar.setEnabled(bAlterar);
                      btExcluir.setEnabled(bExcluir);
                      btCancelar.setEnabled(bCancelar);
                    }

    
       
   
       
           
}  [/code]

[quote]tá dando um erro só é esse :[/quote]


[code]C:\Documents and Settings\Administrador\Suporte1\src\suporte1\Main.java:117: unreported exception java.text.ParseException; must be caught or declared to be thrown
                        new Date(df.parse(dataStr).getTime()) + "," +

_se eu implementar a parse exception ,pq o editor acusa que precisa, fala que o actionperformed não suporta essa exceção.