[RESOLVIDO] java.lang.NullPointerException

galera estou com problema nisso aqui… não sei o que pode ser… não consigo add o fornecedor, fiz igual ao cliente, mas o Cliente add e o fornecedor não!

No Cliente

[code]

        Cliente cliente = new Cliente();
        cliente.setNome(txtnome.getText());
        cliente.setCpf(txtCPF.getText());
        cliente.setRg(txtRG.getText());
        cliente.setData_nascimento((Calendar) ((JCalendar) ccbdatanasc).getSelectedItem());
        cliente.setTelefone_casa(txttelefone.getText());
        cliente.setTelefone_celular(txtcelular.getText());
        cliente.setTelefone_outro(txttelrecado.getText());
        cliente.setEmail(txtemail.getText());    
     try {   
        dao.salvar(cliente);
        controle.setStatus("Cliente Adcionado");
        controle.carregartabela();
        setVisible(false);
    } catch (Exception ex) {
        ex.printStackTrace();
        JOptionPane.showMessageDialog(this,"Erro ao adicionar o cliente" + ex, "Adicionar novo cliente",JOptionPane.ERROR_MESSAGE);
        return;
    }[/code]

No fornecedor



 Fornecedor fornecedor = new Fornecedor();
          fornecedor.setNome_razao_social(txtNomeFantasia.getText());
          fornecedor.setNome_fantasia(txtNomeFantasia.getText());
          fornecedor.setCnpj(txtCnpj.getText());
          fornecedor.setTelefone1(txtTelefone1.getText());
          fornecedor.setTelefone2(txtTelefone2.getText());
          fornecedor.setTelefone3(txtTelefone3.getText());
          fornecedor.setEmail(txtEmail.getText());
        try {
            dao.salvar(fornecedor);
            controle.setStatus("Fornecedor Adicionado");
            controle.carregartela();
            setVisible(false);
        } catch (Exception ex) {
            ex.printStackTrace();
            JOptionPane.showMessageDialog(this,"Erro ao adicionar o Fornecedor " + ex, " Adicionar novo cliente",JOptionPane.ERROR_MESSAGE);
            return;
        }

e retorna isso

java.lang.NullPointerException

Posta a mensagem de erro toda… pois deu nullPointerException, possivelmente tem algo que não foi instanciado.

bem coloquei tudo agora :smiley:

deu esse erro aqui

[code]

java.lang.NullPointerException
at br.com.banhotosa.View.FrmaddFornecedor.btOkActionPerformed(FrmaddFornecedor.java:249)
at br.com.banhotosa.View.FrmaddFornecedor.access$100(FrmaddFornecedor.java:18)
at br.com.banhotosa.View.FrmaddFornecedor$2.actionPerformed(FrmaddFornecedor.java:132)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:702)
at java.awt.EventQueue$4.run(EventQueue.java:700)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1005)
at br.com.banhotosa.View.FrmFornecedor.btnovoActionPerformed(FrmFornecedor.java:170)
at br.com.banhotosa.View.FrmFornecedor.access$100(FrmFornecedor.java:19)
at br.com.banhotosa.View.FrmFornecedor$2.actionPerformed(FrmFornecedor.java:66)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:702)
at java.awt.EventQueue$4.run(EventQueue.java:700)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1005)
at br.com.banhotosa.View.FrmPrincipal.jButton4ActionPerformed(FrmPrincipal.java:235)
at br.com.banhotosa.View.FrmPrincipal.access$300(FrmPrincipal.java:16)
at br.com.banhotosa.View.FrmPrincipal$4.actionPerformed(FrmPrincipal.java:88)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:702)
at java.awt.EventQueue$4.run(EventQueue.java:700)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)[/code]

Coloque o conteúdo das linhas 249, 18 e 132 da classe br.com.banhotosa.View.FrmaddFornecedor .

asousaj

como assim? não itendi!

Vá na linha que ele disse e posta o código aqui no tópico.

  try {                                                                        //linha 248
            dao.salvar(fornecedor);                                  //linha 249
            controle.setStatus("Fornecedor Adicionado");  //linha 250
            controle.carregartela();                                //linha 251
            setVisible(false);                                         //linha 252


public class FrmaddFornecedor extends javax.swing.JDialog { //linha 18
    private final FornecedorDAO dao;                                     //linha 19
    private final FrmFornecedor controle;                               //linha 20


 btOk.setText("Ok");
        btOk.addActionListener(new java.awt.event.ActionListener() {                //linha 130
            public void actionPerformed(java.awt.event.ActionEvent evt) {          //linha 131 
                btOkActionPerformed(evt);                                                        //linha 132

Coloca um breakpoint na linha 249 e roda em modo debug.
Verifica se o dao desta linha não estará null. Deve ser isso.

então cara ele pula do linha 249 para linha 253


          dao.salvar(fornecedor); // linha 249
            controle.setStatus("Fornecedor Adicionado");
            controle.carregartela();
            setVisible(false);
        } catch (Exception ex) {// linha 253

Ele tá pulando pois tá dando uma exception.
Faz o seguinte uma linha antes da 249 coloca:

System.out.println(dao)

Verifica na console se tá null.

viiiiish


 Fornecedor fornecedor0_
null
java.lang.NullPointerException

como arrumar isso?

Antes de usar o dao você deve inicializa-lo.

Fica difícil apontar onde sem saber como está o programa, mas faltou algo tipo assim:

FornecedorDAO dao =  new FornecedorDAO(); //considerando FornecedorDAO uma classe concreta

Melhor seguir uma apostila ou tutorial neste caso.

então querido, eu fiz certinho, mas como eu disse, o Cliente add certinho e o Fornecedor não?
porque será?

a fiz como vc me disse.

            FornecedorDAO dao = new FornecedorDAO();
            dao.salvar(fornecedor);

e retornou isso…

Hibernate: 
    select
        fornecedor0_.codigo_fornecedor as codigo1_7_,
        fornecedor0_.Email as Email2_7_,
        fornecedor0_.cnpj as cnpj3_7_,
        fornecedor0_.nome_fantasia as nome4_7_,
        fornecedor0_.nome_razao_social as nome5_7_,
        fornecedor0_.telefone1 as telefone6_7_,
        fornecedor0_.telefone2 as telefone7_7_,
        fornecedor0_.telefone3 as telefone8_7_ 
    from
        Fornecedor fornecedor0_
null
Hibernate: 
    insert 
    into
        Fornecedor
        (Email, cnpj, nome_fantasia, nome_razao_social, telefone1, telefone2, telefone3) 
    values
        (?, ?, ?, ?, ?, ?, ?)
java.lang.NullPointerException
	at br.com.banhotosa.View.FrmaddFornecedor.btOkActionPerformed(FrmaddFornecedor.java:252)
	at br.com.banhotosa.View.FrmaddFornecedor.access$100(FrmaddFornecedor.java:18)
	at br.com.banhotosa.View.FrmaddFornecedor$2.actionPerformed(FrmaddFornecedor.java:132)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6505)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
	at java.awt.Component.processEvent(Component.java:6270)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4861)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:688)
	at java.awt.EventQueue$3.run(EventQueue.java:686)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:702)
	at java.awt.EventQueue$4.run(EventQueue.java:700)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
	at java.awt.Dialog.show(Dialog.java:1082)
	at java.awt.Component.show(Component.java:1651)
	at java.awt.Component.setVisible(Component.java:1603)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at br.com.banhotosa.View.FrmFornecedor.btnovoActionPerformed(FrmFornecedor.java:170)
	at br.com.banhotosa.View.FrmFornecedor.access$100(FrmFornecedor.java:19)
	at br.com.banhotosa.View.FrmFornecedor$2.actionPerformed(FrmFornecedor.java:66)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6505)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
	at java.awt.Component.processEvent(Component.java:6270)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4861)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:688)
	at java.awt.EventQueue$3.run(EventQueue.java:686)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:702)
	at java.awt.EventQueue$4.run(EventQueue.java:700)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
	at java.awt.Dialog.show(Dialog.java:1082)
	at java.awt.Component.show(Component.java:1651)
	at java.awt.Component.setVisible(Component.java:1603)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at br.com.banhotosa.View.FrmPrincipal.jButton4ActionPerformed(FrmPrincipal.java:263)
	at br.com.banhotosa.View.FrmPrincipal.access$300(FrmPrincipal.java:16)
	at br.com.banhotosa.View.FrmPrincipal$4.actionPerformed(FrmPrincipal.java:90)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6505)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
	at java.awt.Component.processEvent(Component.java:6270)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4861)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:688)
	at java.awt.EventQueue$3.run(EventQueue.java:686)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:702)
	at java.awt.EventQueue$4.run(EventQueue.java:700)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Já testou também se fornecedor não está null?

Se pudesse anexar a classe inteira ficaria mais fácil ajudar.

opa vamos lá… classe fornecedor…

@Entity
public class Fornecedor {
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column
	@NotNull
         @SwingColumn(description="Código",colorOfBackgound="")
	private Integer codigo_fornecedor;
	@Column
	@NotNull
         @SwingColumn(description="Nome Razão Social",colorOfBackgound="")
	private String nome_razao_social;
	@Column
         @SwingColumn(description="Nome Fantasia",colorOfBackgound="")
	private String nome_fantasia;
	@Column
         @SwingColumn(description="CNPJ",colorOfBackgound="")
	private String cnpj;
	@Column
         @SwingColumn(description="Telefone1",colorOfBackgound="")
	private String telefone1;
	@Column
         @SwingColumn(description="Telefone2",colorOfBackgound="")
	private String telefone2;
	@Column
         @SwingColumn(description="Telefone3",colorOfBackgound="")
	private String telefone3;
         @Column
       @SwingColumn(description="Email",colorOfBackgound="")
       private String Email;
	@OneToMany (mappedBy="codigo_endereco")
	private List<Endereco> enderecos = new ArrayList<>();

	@OneToMany(mappedBy="codigo_entrada")
	private List<Entrada> Entradas = new ArrayList<>();

        
          public String getEmail() {
               return Email;
          }

         public void setEmail(String Email) {
             this.Email = Email;
            }
    
	public Integer getCodigo_fornecedor() {
		return codigo_fornecedor;
	}

	public void setCodigo_fornecedor(Integer codigo_fornecedor) {
		this.codigo_fornecedor = codigo_fornecedor;
	}

	public String getNome_razao_social() {
		return nome_razao_social;
	}

	public void setNome_razao_social(String nome_razao_social) {
		this.nome_razao_social = nome_razao_social;
	}

	public String getNome_fantasia() {
		return nome_fantasia;
	}

	public void setNome_fantasia(String nome_fantasia) {
		this.nome_fantasia = nome_fantasia;
	}

	public String getCnpj() {
		return cnpj;
	}

	public void setCnpj(String cnpj) {
		this.cnpj = cnpj;
	}

	public String getTelefone1() {
		return telefone1;
	}

	public void setTelefone1(String telefone1) {
		this.telefone1 = telefone1;
	}

	public String getTelefone2() {
		return telefone2;
	}

	public void setTelefone2(String telefone2) {
		this.telefone2 = telefone2;
	}

	public String getTelefone3() {
		return telefone3;
	}

	public void setTelefone3(String telefone3) {
		this.telefone3 = telefone3;
	}

	public List<Endereco> getEnderecos() {
		return enderecos;
	}

	public void setEnderecos(List<Endereco> enderecos) {
		this.enderecos = enderecos;
	}

	public List<Entrada> getEntradas() {
		return Entradas;
	}

	public void setEntradas(List<Entrada> entradas) {
		Entradas = entradas;
	}	
	
}

classe fornecedorDAO

public class FornecedorDAO {
	
	public void salvar(Fornecedor novoFornecedor) {

		EntityManager em = EntityManagerUtil.getEntityManager();

		try {

			em.getTransaction().begin();
			em.persist(novoFornecedor);
			em.getTransaction().commit();

		} catch (Exception e) {

			e.printStackTrace();
			em.getTransaction().rollback();

		} finally {

			em.close();

		}
	}
	
public void editar(Fornecedor fornecedorEditar){
		
		EntityManager em = EntityManagerUtil.getEntityManager();
		
		try{
			
			em.getTransaction().begin();
			em.merge(fornecedorEditar);
			em.getTransaction().commit();
			
		}catch(Exception e){
			
			e.printStackTrace();
			em.getTransaction().rollback();
			
		}finally{
			
			em.close();
			
		}
		
	}

	public void excluir(Integer codigo_Fornecedor) {

		EntityManager em = EntityManagerUtil.getEntityManager();

		try {

			em.getTransaction().begin();

			Query query = em.createQuery(
					"DELETE FROM Fornecedor fr WHERE fr.codigo_fornecedor =? ")
					.setParameter(1, codigo_Fornecedor);

			query.executeUpdate();

			em.getTransaction().commit();

		} catch (Exception e) {

			e.printStackTrace();
			em.getTransaction().rollback();

		} finally {

			em.close();

		}

	}

	@SuppressWarnings("unchecked")
	public List<Fornecedor> listar(){
		
		EntityManager em = EntityManagerUtil.getEntityManager();
		
		List<Fornecedor> fornecedores = new ArrayList<Fornecedor>();
		
		try{
			
			Query query = em.createQuery("from Fornecedor");
			fornecedores = query.getResultList();
			
		}catch(Exception e){
			
			e.printStackTrace();
			
		}finally{
			
			em.close();
			
		}
		
		return fornecedores;
		
	}
	
	@SuppressWarnings("unchecked")
	public List<Fornecedor> listarFornecedorNome (String nome_Fornecedor){
		
		EntityManager em = EntityManagerUtil.getEntityManager();
		
		List<Fornecedor> fornecedoresRecuperados = new ArrayList<Fornecedor>();
		
		nome_Fornecedor = nome_Fornecedor+"%";
					
		try {
			
			Query query = em.createQuery("Select from Fornecedores fr where LIKE fr.descricao").setParameter(1, nome_Fornecedor);
			fornecedoresRecuperados = query.getResultList();
			
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			em.close();
		}
		
		return fornecedoresRecuperados ;
	}


}

e desculpa o incomodo!

Pode postar tambéma FrmaddFornecedor completa?
Pela pilha de erroa falha deve estar nela.

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.banhotosa.View;

import br.com.banhotosa.Dao.FornecedorDAO;
import br.com.banhotosa.Model.Cliente;
import br.com.banhotosa.Model.Fornecedor;
import comp.JCalendar;
import java.util.Calendar;
import javax.swing.JOptionPane;

/**
 *
 * @author Rafael Almeida
 */
public class FrmaddFornecedor extends javax.swing.JDialog {
    private final FornecedorDAO dao;
    private final FrmFornecedor controle;

    /**
     * Creates new form FrmaddFornecedor
     */
    public FrmaddFornecedor(java.awt.Frame parent, boolean modal, FornecedorDAO dao, FrmFornecedor controle ) {
        super(parent, modal);
        this.dao = dao;
        this.controle = controle;
        initComponents();
        txtNomeRazao.requestFocus();
    }

    /**
     * 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() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txtNomeRazao = new javax.swing.JTextField();
        txtNomeFantasia = new javax.swing.JTextField();
        txtCnpj = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        txtTelefone1 = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        txtTelefone2 = new javax.swing.JTextField();
        txtTelefone3 = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        txtEmail = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        btOk = new javax.swing.JButton();
        btCancelar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Cadastrar Fornecedor");

        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.setToolTipText("Cadastrar Fornecedor");

        jLabel1.setText("Nome Razão Social :");

        jLabel2.setText("Nome Fantasia :");

        jLabel3.setText("CNPJ :");

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("[Contatos]"));

        jLabel5.setText("Telefone:");

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

        jLabel6.setText("Telefone 2:");

        jLabel7.setText("Telefone 3:");

        jLabel8.setText("E-mail:");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtEmail, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
                    .addComponent(txtTelefone3, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTelefone2, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTelefone1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(txtTelefone1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtTelefone2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtTelefone3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addGap(0, 9, Short.MAX_VALUE))
        );

        btOk.setText("Ok");
        btOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btOkActionPerformed(evt);
            }
        });

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

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(txtNomeRazao)
                                    .addComponent(txtNomeFantasia, javax.swing.GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE)
                                    .addComponent(txtCnpj, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(159, 159, 159)
                        .addComponent(btOk)
                        .addGap(18, 18, 18)
                        .addComponent(btCancelar)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtNomeRazao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtNomeFantasia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txtCnpj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btOk)
                    .addComponent(btCancelar))
                .addContainerGap(39, Short.MAX_VALUE))
        );

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

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

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

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

        setVisible(false);
        
        // TODO add your handling code here:
    }                                          

    private void btOkActionPerformed(java.awt.event.ActionEvent evt) {                                     
   if (txtNomeRazao.getText().equals("")) {
            JOptionPane.showMessageDialog(this,"O campo Razão Social precisa estar preenchido", "Validação",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if (txtTelefone1.getText().equals("")) {
            JOptionPane.showMessageDialog(this,"O campo telefone precisa estar preenchido","Validation",JOptionPane.ERROR_MESSAGE);
            return;
        }
       
        int result = JOptionPane.showConfirmDialog(this, "Você tem certeza?", "Adicionar novo Fornecedor",JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
        if (result != 0) {
            return;
        }
     
          Fornecedor fornecedor = new Fornecedor();
          fornecedor.setNome_razao_social(txtNomeFantasia.getText());
          fornecedor.setNome_fantasia(txtNomeFantasia.getText());
          fornecedor.setCnpj(txtCnpj.getText());
          fornecedor.setTelefone1(txtTelefone1.getText());
          fornecedor.setTelefone2(txtTelefone2.getText());
          fornecedor.setTelefone3(txtTelefone3.getText());
          fornecedor.setEmail(txtEmail.getText());
          System.out.println(dao);  
        try {
            FornecedorDAO dao = new FornecedorDAO();
            dao.salvar(fornecedor);
            controle.setStatus("Fornecedor Adicionado");
            controle.carregartela();
            setVisible(false);
        } catch (Exception ex) {
            ex.printStackTrace();
            JOptionPane.showMessageDialog(this,"Erro ao adicionar o Fornecedor " + ex, " Adicionar novo cliente",JOptionPane.ERROR_MESSAGE);
            return;
        }
        
        // TODO add your handling code here:
    }                                    

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrmaddFornecedor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrmaddFornecedor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrmaddFornecedor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrmaddFornecedor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                FrmaddFornecedor dialog = new FrmaddFornecedor(new javax.swing.JFrame(), true, null, null);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify                     
    private javax.swing.JButton btCancelar;
    private javax.swing.JButton btOk;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField txtCnpj;
    private javax.swing.JTextField txtEmail;
    private javax.swing.JTextField txtNomeFantasia;
    private javax.swing.JTextField txtNomeRazao;
    private javax.swing.JTextField txtTelefone1;
    private javax.swing.JTextField txtTelefone2;
    private javax.swing.JTextField txtTelefone3;
    // End of variables declaration                   
}

valew… :smiley:

Achei a falha:

Pode retirar em FrmaddFornecedor a linha abaixo.

FornecedorDAO dao = new FornecedorDAO(); 

Pois no construtor da sua classe você recebe o dao e controle.

 public FrmaddFornecedor(java.awt.Frame parent, boolean modal, FornecedorDAO dao, FrmFornecedor controle ) {  
        super(parent, modal);  
        this.dao = dao;  
        this.controle = controle;  
        initComponents();  
        txtNomeRazao.requestFocus();  
    }  

O problema é sua main neste ponto, onde está passando o dao e controle como null.

FrmaddFornecedor dialog = new FrmaddFornecedor(new javax.swing.JFrame(), true, null, null); 

Talvez isso resolva

FrmaddFornecedor dialog = new FrmaddFornecedor(new javax.swing.JFrame(), true, new FornecedorDAO() , new FrmFornecedor()); 

vooooooti cara, valew… era isso mesmo…
poxa me ajudou muito…
ficou assim o codigo tem problema?

FrmaddEndereco dialog = new FrmaddEndereco(new javax.swing.JFrame(), true, new FornecedorDAO(), null);

tem algum problema o outro ficar null???

está funcionando certinho… :smiley: