Ao executar

3 respostas
Oziel_Morais

Tenho uma aplicação desktop no netbeans, mas toda vez ao executar Shift+F6 para rodar a aplicação ele roda e funciona mas sempre aparece isso aqui :

[color=red]init:
Deleting: D:\Diaria - Oziel\diaria\build\built-jar.properties
deps-jar:
Updating property file: D:\Diaria - Oziel\diaria\build\built-jar.properties
Compiling 1 source file to D:\Diaria - Oziel\diaria\build\classes
Note: D:\Diaria - Oziel\diaria\src\FCadUser.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation fo
Note: Recompile with -Xlint:deprecation for details.
compile-single:
run-single:
[/color]
Alguém por favor tem alguma sugestão de como tirar isso???
ao executar a aplicação…

3 Respostas

luxu

Algum método q vc usa nessa classe(FCadUser) está depreciada, ou seja, já tem um método mais novo…v ai!

Oziel_Morais

Não tô conseguindo achar o que é por favor me deem dicas aqui esta a classe FCadUser.

public class FCadUser extends javax.swing.JFrame {
    
    /** Creates new form FCadUser */
    public FCadUser() {
        initComponents();
        setBounds(200,200,350,350);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        txtUser = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        txtSenha = new javax.swing.JPasswordField();
        jLabel3 = new javax.swing.JLabel();
        txtemail = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jCB_nivel = new javax.swing.JComboBox();
        btnCancelar = new javax.swing.JButton();
        btnSalvar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Gerenciador de Diárias IFRN Oziel");
        setResizable(false);
        getContentPane().setLayout(null);

        txtUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtUserActionPerformed(evt);
            }
        });
        getContentPane().add(txtUser);
        txtUser.setBounds(120, 50, 200, 20);

        jLabel2.setText("Digite o Login:");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(20, 50, 110, 14);
        getContentPane().add(txtSenha);
        txtSenha.setBounds(120, 80, 200, 20);

        jLabel3.setText("Digite a Senha:");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(20, 80, 100, 14);
        getContentPane().add(txtemail);
        txtemail.setBounds(120, 110, 200, 20);

        jLabel5.setText("E-mail: ");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(20, 110, 70, 14);

        jLabel4.setText("Perfil:");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(20, 140, 70, 14);

        jCB_nivel.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "ADMINISTRADOR", "FUNCIONARIO" }));
        getContentPane().add(jCB_nivel);
        jCB_nivel.setBounds(120, 140, 200, 20);

        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });
        getContentPane().add(btnCancelar);
        btnCancelar.setBounds(220, 190, 100, 23);

        btnSalvar.setText("Salvar");
        btnSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalvarActionPerformed(evt);
            }
        });
        getContentPane().add(btnSalvar);
        btnSalvar.setBounds(120, 190, 100, 23);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel1.setText("Cadastrar Usuário");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(80, 0, 220, 29);

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

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

        this.dispose();
    }                                           

    private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {                                          
    //============================================================
    //Se os campos estiverem em Branco retorna a menssagem abaixo!
    //============================================================ 
        if(txtUser.getText().length() == 0 || txtSenha.getPassword().length == 0 ){        
         JOptionPane.showMessageDialog(null,"Preencha os campos","ATENÇÃO",JOptionPane.WARNING_MESSAGE);         
        }else{
     //============================================================
    //Senão Cadastra o usuário no banco
    //============================================================ 
        ClassCadUsuario usuario = new ClassCadUsuario();
        usuario.setUsuario(txtUser.getText(), txtSenha.getText(),txtemail.getText(), jCB_nivel.getSelectedItem().toString());
        usuario.incluiUsuario();   
                 
         }
         
         FLogon l = new FLogon();
         l.show();
        
         this.dispose();
    }                                         

private void txtUserActionPerformed(java.awt.event.ActionEvent evt) {                                        
// TODO add your handling code here:
}                                       
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FCadUser().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify                     
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnSalvar;
    private javax.swing.JComboBox jCB_nivel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPasswordField txtSenha;
    private javax.swing.JTextField txtUser;
    private javax.swing.JTextField txtemail;
    // End of variables declaration                   
    
}
S

Oziel Morais:

[color=red]Note: D:\Diaria - Oziel\diaria\src\FCadUser.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation fo
Note: Recompile with -Xlint:deprecation for details.
[/color]

Está usando um método deprecated, por exemplo o [color=blue]show()[/color] do JFrame ou do JDialog.
Não uso, mas o Netbeans deve ter uma opção para mostrar/marcar esses erros.

EDIT1:
esse título não ajuda em nada! :expressionless:

Criado 11 de fevereiro de 2012
Ultima resposta 15 de fev. de 2012
Respostas 3
Participantes 3