Erro ActionPerformed

10 respostas
G

Estranho é que quando clico em gravar ele so retorna algum erro se o campo celular estiver vazio, se tiver tudo preenchido, ele nao retorna nada.

codigo formulario contato

/*

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

/*

  • Contato.java
  • Created on 07/11/2011, 11:13:11
    */
    package agenda;
import Classes.Celular;

import Classes.Telefone;

import Servicos.ServicoContato;

import javax.swing.JOptionPane;

/**
*

  • @author Guilherme
    */
    public class Contato extends javax.swing.JFrame {

    /** Creates new form Contato */
    
    public Contato() {
    
    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)
      
      // 
      
      private void initComponents() {
      
      Sair = new javax.swing.JButton();
      
      Nome = new javax.swing.JTextField();
      
      Sobrenome = new javax.swing.JTextField();
      
      CPF = new javax.swing.JTextField();
      
      rNome = new javax.swing.JLabel();
      
      rSobrenome = new javax.swing.JLabel();
      
      rCPF = new javax.swing.JLabel();
      
      NContato = new javax.swing.JLabel();
      
      rRG = new javax.swing.JLabel();
      
      RG = new javax.swing.JTextField();
      
      rEmail = new javax.swing.JLabel();
      
      rSite = new javax.swing.JLabel();
      
      Email = new javax.swing.JTextField();
      
      Site = new javax.swing.JTextField();
      
      rTelefone = new javax.swing.JLabel();
      
      rCelular = new javax.swing.JLabel();
      
      Telefone = new javax.swing.JTextField();
      
      Celular = new javax.swing.JTextField();
      
      Gravar = new javax.swing.JButton();
      

      setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
      setTitle(“ΔgendΔ - Novo contato”);

      Sair.setText(Sair);
      
      Sair.addActionListener(new java.awt.event.ActionListener() {
      
      public void actionPerformed(java.awt.event.ActionEvent evt) {
      
      SairActionPerformed(evt);
      
      }
      
      });
      
      Sobrenome.addActionListener(new java.awt.event.ActionListener() {
      
      public void actionPerformed(java.awt.event.ActionEvent evt) {
      
      SobrenomeActionPerformed(evt);
      
      }
      
      });
      
      CPF.addActionListener(new java.awt.event.ActionListener() {
      
      public void actionPerformed(java.awt.event.ActionEvent evt) {
      
      CPFActionPerformed(evt);
      
      }
      
      });
      

      rNome.setText(“Nome”);

      rSobrenome.setText(“Sobrenome”);

      rCPF.setText(“CPF”);

      NContato.setFont(new java.awt.Font(“Tahoma”, 1, 14));
      NContato.setText(“Novo contato”);

      rRG.setText(“RG”);

      rEmail.setText(“Email”);

      rSite.setText(“Site”);

      rTelefone.setText(“Telefone”);

      rCelular.setText(“Celular”);

      Celular.addActionListener(new java.awt.event.ActionListener() {
      
      public void actionPerformed(java.awt.event.ActionEvent evt) {
      
      CelularActionPerformed(evt);
      
      }
      
      });
      
      Gravar.setText(Gravar);
      
      Gravar.addActionListener(new java.awt.event.ActionListener() {
      
      public void actionPerformed(java.awt.event.ActionEvent evt) {
      
      GravarActionPerformed(evt);
      
      }
      
      });
      
      javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
      
      getContentPane().setLayout(layout);
      
      layout.setHorizontalGroup(
      
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      
      .addGroup(layout.createSequentialGroup()
      
      .addGap(10, 10, 10)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      
      .addGroup(layout.createSequentialGroup()
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      
      .addComponent(rSobrenome)
      
      .addComponent(rNome)
      
      .addComponent(rCPF)
      
      .addComponent(rRG)
      
      .addComponent(rEmail)
      
      .addComponent(rSite)
      
      .addComponent(rTelefone))
      
      .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
      
      .addComponent(Celular, javax.swing.GroupLayout.Alignment.LEADING)
      
      .addComponent(Telefone, javax.swing.GroupLayout.Alignment.LEADING)
      
      .addComponent(Site, javax.swing.GroupLayout.Alignment.LEADING)
      
      .addComponent(Email, javax.swing.GroupLayout.Alignment.LEADING)
      
      .addComponent(RG, javax.swing.GroupLayout.Alignment.LEADING)
      
      .addComponent(CPF, javax.swing.GroupLayout.Alignment.LEADING)
      
      .addComponent(Sobrenome, javax.swing.GroupLayout.Alignment.LEADING)
      
      .addComponent(Nome, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 303, Short.MAX_VALUE)
      
      .addComponent(Gravar)))
      
      .addComponent(rCelular))
      
      .addContainerGap())
      
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
      
      .addContainerGap(164, Short.MAX_VALUE)
      
      .addComponent(NContato)
      
      .addGap(141, 141, 141))
      
      .addGroup(layout.createSequentialGroup()
      
      .addContainerGap()
      
      .addComponent(Sair)
      
      .addContainerGap(337, Short.MAX_VALUE))
      
      );
      
      layout.setVerticalGroup(
      
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
      
      .addContainerGap()
      
      .addComponent(NContato)
      
      .addGap(20, 20, 20)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(rNome)
      
      .addComponent(Nome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
      
      .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(rSobrenome)
      
      .addComponent(Sobrenome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
      
      .addGap(6, 6, 6)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(rCPF)
      
      .addComponent(CPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
      
      .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(rRG)
      
      .addComponent(RG, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
      
      .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(rEmail)
      
      .addComponent(Email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
      
      .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(Site, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
      
      .addComponent(rSite))
      
      .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(Telefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
      
      .addComponent(rTelefone))
      
      .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(rCelular)
      
      .addComponent(Celular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
      
      .addGap(16, 16, 16)
      
      .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      
      .addComponent(Sair)
      
      .addComponent(Gravar))
      
      .addContainerGap())
      
      );
      

      pack();
      }//

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

dispose();

// TODO add your handling code here:

}
private void SobrenomeActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

}
private void CPFActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

}
private void GravarActionPerformed(java.awt.event.ActionEvent evt) {

if (Nome.getText().equals("")) {

JOptionPane.showMessageDialog(null, Digite o nome!);

Nome.requestFocus();

} else if (Sobrenome.getText().equals("")) {

JOptionPane.showMessageDialog(null, Digite o sobrenome!);

Sobrenome.requestFocus();

} else if (CPF.getText().equals("")) {

JOptionPane.showMessageDialog(null, Digite o CPF!);

CPF.requestFocus();

} else if (RG.getText().equals("")) {

JOptionPane.showMessageDialog(null, Digite o RG!);

RG.requestFocus();

} else if (Email.getText().equals("")) {

JOptionPane.showMessageDialog(null, Digite o Email!);

Email.requestFocus();

} else if (Site.getText().equals("")) {

JOptionPane.showMessageDialog(null, Digite o Site!);

Site.requestFocus();

} else if (Telefone.getText().equals("")) {

JOptionPane.showMessageDialog(null, Digite o Telefone!);

Telefone.requestFocus();

} else if (Celular.getText().equals("")) {

JOptionPane.showMessageDialog(null, Digite o Celular!);

Celular.requestFocus();

{
Contato entity = new Contato();
        entity.setNome(Nome.getText());
        entity.setSobrenome(Sobrenome.getText());
        entity.setCPF(CPF.getText());
        entity.setRG(RG.getText());
        entity.setEmail(Email.getText());
        entity.setSite(Site.getText());
            Telefone tel = new Telefone();
            tel.setTelefone(Telefone.getText());
                Celular cel = new Celular();
                cel.setCelular(Celular.getText());
       
       
        ServicoContato servicoContato = new ServicoContato();
        servicoContato.insert(entity);
        JOptionPane.showMessageDialog(this, "Contato cadastrado!");
        }
}
   
// TODO add your handling code here:

}

private void CelularActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // 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(Contato.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(Contato.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(Contato.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(Contato.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    }
    //</editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {

        public void run() {
            new Contato().setVisible(true);
        }
    });
}
// Variables declaration - do not modify                     
private javax.swing.JTextField CPF;
private javax.swing.JTextField Celular;
private javax.swing.JTextField Email;
private javax.swing.JButton Gravar;
private javax.swing.JLabel NContato;
private javax.swing.JTextField Nome;
private javax.swing.JTextField RG;
private javax.swing.JButton Sair;
private javax.swing.JTextField Site;
private javax.swing.JTextField Sobrenome;
private javax.swing.JTextField Telefone;
private javax.swing.JLabel rCPF;
private javax.swing.JLabel rCelular;
private javax.swing.JLabel rEmail;
private javax.swing.JLabel rNome;
private javax.swing.JLabel rRG;
private javax.swing.JLabel rSite;
private javax.swing.JLabel rSobrenome;
private javax.swing.JLabel rTelefone;
// End of variables declaration                   

private void setNome(String text) {
    throw new UnsupportedOperationException("Not yet implemented");
}

private void setSobrenome(String text) {
    throw new UnsupportedOperationException("Not yet implemented");
}

private void setCPF(String text) {
    throw new UnsupportedOperationException("Not yet implemented");
}

private void setRG(String text) {
    throw new UnsupportedOperationException("Not yet implemented");
}

private void setEmail(String text) {
    throw new UnsupportedOperationException("Not yet implemented");
}

private void setSite(String text) {
    throw new UnsupportedOperationException("Not yet implemented");
}

}

erro

<blockquote>Exception in thread AWT-EventQueue-0 java.lang.UnsupportedOperationException: Not yet implemented

at agenda.Contato.setNome(Contato.java:321)

at agenda.Contato.GravarActionPerformed(Contato.java:238 )

at agenda.Contato.access$400(Contato.java:22)

at agenda.Contato$5.actionPerformed(Contato.java:108 )

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:6504)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)

at java.awt.Component.processEvent(Component.java:6269)

at java.awt.Container.processEvent(Container.java:2229)

at java.awt.Component.dispatchEventImpl(Component.java:4860)

at java.awt.Container.dispatchEventImpl(Container.java:2287)

at java.awt.Component.dispatchEvent(Component.java:4686)

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:2713)

at java.awt.Component.dispatchEvent(Component.java:4686)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)

at java.awt.EventQueue.access$000(EventQueue.java:101)

at java.awt.EventQueue$3.run(EventQueue.java:666)

at java.awt.EventQueue$3.run(EventQueue.java:664)

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:680)

at java.awt.EventQueue$4.run(EventQueue.java:678 )

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128 )

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

</blockquote>

estou usando netbeans com firebird, se for util envio para email (envie uma mensagem) o projeto com o banco de dados + o driver de conexão netbeans/firebird.
Valeu pela ajuda pessoal!

10 Respostas

discorpio

Boa tarde Guilherme Lessa.

O reportado informa que está sendo gerado é no método setNome(…) e não no setCelular, isto porque o método setNome está implementado para provocar o erro com a sintaxe “throw”, ou seja, voce mesmo o programou para que a Exceção (erro) fosse disparada(o), com a implementação abaixo:

private void setNome(String text) {
      /* Aqui a exceção (erro) está sendo disparada
          manualmente via código com a sintaxe throw */ 
      throw new UnsupportedOperationException("Not yet implemented"); 
  }
G

Então, não se pode deletar esses set’s, ele provoca erro logo acima nos entity.get…

Porém deixei eles nulos, mas o erro é exatamente o mesmo, nao retorna nada se preencher tudo, e sem celular retorna os erros.

Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not yet implemented at Classes.Telefone.setTelefone(Telefone.java:17) at agenda.Contato.GravarActionPerformed(Contato.java:245) at agenda.Contato.access$400(Contato.java:22) at agenda.Contato$5.actionPerformed(Contato.java:108 ) 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:6504) at javax.swing.JComponent.processMouseEvent(JComponent.java:3321) at java.awt.Component.processEvent(Component.java:6269) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4860) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4686) 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:2713) at java.awt.Component.dispatchEvent(Component.java:4686) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707) at java.awt.EventQueue.access$000(EventQueue.java:101) at java.awt.EventQueue$3.run(EventQueue.java:666) at java.awt.EventQueue$3.run(EventQueue.java:664) 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:680) at java.awt.EventQueue$4.run(EventQueue.java:678 ) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:677) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128 ) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

O que sugere que eu altere?

G

AntonioDiego

remove as linhas:

throw new UnsupportedOperationException("Not yet implemented");
G

Sim. foi isso que fiz, continua o mesmo.

AntonioDiego
entendi o que foi . tenta remover os else e deixa um bloco if pra cada checagem , e coloca return; no fim de cada bloco. tipo:
if (Nome.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Digite o nome!");
Nome.requestFocus();
return;//termina a execuçao do metodo GravarActionPerformed
} 
//nao entrou no if anterior e consequentemente nao chamou o return entao o metodo continua
if (Sobrenome.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Digite o sobrenome!");
Sobrenome.requestFocus();
return;//termina a execuçao do metodo GravarActionPerformed
} 

if (CPF.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Digite o CPF!");
CPF.requestFocus();
return;//termina a execuçao do metodo GravarActionPerformed
}
G

Obrigado Antonio e Discorp, agora ta se comportando bem, o “erro ta vindo certo”.

Mas ainda não ta cadastrando no banco, enfim, isso eu me viro, mas se para vocês não for difícil identificar os problemas agradeço.

Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not yet implemented at Classes.Telefone.setTelefone(Telefone.java:17) at agenda.Contato.GravarActionPerformed(Contato.java:287) at agenda.Contato.access$400(Contato.java:22) at agenda.Contato$5.actionPerformed(Contato.java:108 ) 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:6504) at javax.swing.JComponent.processMouseEvent(JComponent.java:3321) at java.awt.Component.processEvent(Component.java:6269) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4860) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4686) 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:2713) at java.awt.Component.dispatchEvent(Component.java:4686) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707) at java.awt.EventQueue.access$000(EventQueue.java:101) at java.awt.EventQueue$3.run(EventQueue.java:666) at java.awt.EventQueue$3.run(EventQueue.java:664) 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:680) at java.awt.EventQueue$4.run(EventQueue.java:678 ) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:677) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128 ) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

kenneth

Nao seria…

Abraco

rmendes08

Colega, por favor, aprenda a ler as mensagens de erro, senão você vai sofrer demais.

Pelo jeito, você deve ter desenhado toda a sua interface antes para só então implementar os eventos. Bom, acontece que pelo Netbeans, quando você adiciona um controle e e clica para criar um evento, o Netbeans cria o stub do método e a implementação padrão é lançar essa exceção com a mensagem “Not yet implemented”. Tudo o que você precisa fazer é implementar os métodos de eventos apropriadamente ou vasculhar o seu código atrás desses lançamentos de exceção.

AntonioDiego
procure ometodo setTelefone()  at Classes.Telefone.setTelefone(Telefone.java:17)  ;

e veja se nao tem

throw new UnsupportedOperationException(Not yet implemented)  java.lang.UnsupportedOperationException: Not yet implemented ;

troque  - throw new UnsupportedOperationException(Not yet implemented) - por - throw new UnsupportedOperationException(Lançando Excessao) .

e veja o que vai acontecer no erro.
Criado 8 de novembro de 2011
Ultima resposta 9 de nov. de 2011
Respostas 10
Participantes 5