Netbeans - error en codigo

 
Vista:

error en codigo

Publicado por nancy (2 intervenciones) el 03/07/2014 17:56:49
hola tengo un jframe en la parte del codigo tengo esto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
package cliente;
import com.mysql.jdbc.PreparedStatement;
import java.sql.Connection;
import javax.sql.*;
/**
 *
 * @author nan
 */
public class nan extends javax.swing.JFrame {
    private Object objPersona;
 
    /** Creates new form nan */
    public nan() {
        initComponents();
        limpiar();
        bloquear();
 
    }
void limpiar(){
    t_nom.setText("");
    t_correo.setText("");
    t_tel.setText("");
 
 
}
   void bloquear(){
      t_nom.setEnabled(false);
    t_correo.setEnabled(false);
    t_tel.setEnabled(false);
    jButton3.setEnabled(true);
    jButton1.setEnabled(true);
 
   }
    void desbloquear(){
      t_nom.setEnabled(true);
    t_correo.setEnabled(true);
    t_tel.setEnabled(true);
    jButton3.setEnabled(true);
    jButton1.setEnabled(true);
 
   }
 
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {
 
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        t_nom = new javax.swing.JTextField();
        t_correo = new javax.swing.JTextField();
        t_tel = new javax.swing.JTextField();
        jButton4 = new javax.swing.JButton();
 
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 
        jButton1.setText("guardar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
 
        jButton2.setText("jButton2");
 
        jButton3.setText("actualizar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
 
        jLabel1.setText("nombre");
 
        jLabel2.setText("correo");
 
        jLabel3.setText("telefono");
 
        t_nom.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                t_nomActionPerformed(evt);
            }
        });
 
        t_correo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                t_correoActionPerformed(evt);
            }
        });
 
        t_tel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                t_telActionPerformed(evt);
            }
        });
 
        jButton4.setText("salir");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(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()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addComponent(jButton1))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel3))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton4))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(t_tel, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(t_correo, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(t_nom, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE)))
                .addContainerGap(164, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(t_nom, 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(jLabel2)
                    .addComponent(t_correo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(t_tel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton3)
                    .addComponent(jButton4))
                .addGap(125, 125, 125))
        );
 
        pack();
    }// </editor-fold>                        
 
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
      bloquear();
 
    }
 
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
    desbloquear();
    t_nom.requestFocus();
    }
 
    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
      this.dispose();
    }
 
    private void t_nomActionPerformed(java.awt.event.ActionEvent evt) {
    t_nom.transferFocus();   // TODO add your handling code here:
    }
 
    private void t_correoActionPerformed(java.awt.event.ActionEvent evt) {
t_correo.transferFocus();        // TODO add your handling code here:
    }
 
    private void t_telActionPerformed(java.awt.event.ActionEvent evt) {
t_tel.transferFocus();        // TODO add your handling code here:
    }
 private void JButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    empleado cc = new empleado();
    Connection cn=cc. conexion();
    String nombre,correo,telefono;
    String sql="";
    nombre=t_nom.getText();
    correo=t_correo.getText();
    telefono=t_correo.getText();
    sql="INSERT INTO cliente (nombre,correo,telefono)VALUES (?,?,?) ";
  try{
    PrepareStatement psd=(PrepareStatement) cn.prepareStatement(sql);
    pst.setString(1,nombre);
    pst.setString(2,correo);
    pst.setString(3,telefono);
    int n=pst.executeUpdate();
    if (n>0){
 
       JOptionPane.showMessageDialog(null,"registro guardado");
      bloquear();
    }
 } catch (SQLException ex){
 
     Logger.getLogger(ing_cli.class.getName()).logLevel.SEVERE, null, ex);
 }
}
 
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new nan().setVisible(true);
            }
        });
    }
 
    // Variables declaration - do not modify                     
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JTextField t_correo;
    private javax.swing.JTextField t_nom;
    private javax.swing.JTextField t_tel;
    // End of variables declaration                   
 
}




el error q me arca esta en esta parte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
try{
    PrepareStatement psd=(PrepareStatement) cn.prepareStatement(sql);
    pst.setString(1,nombre);
    pst.setString(2,correo);
    pst.setString(3,telefono);
    int n=pst.executeUpdate();
    if (n>0){
 
       JOptionPane.showMessageDialog(null,"registro guardado");
      bloquear();
    }
 } catch (SQLException ex){
 
     Logger.getLogger(ing_cli.class.getName()).logLevel.SEVERE, null, ex);
 }
}o


este es el error qe marca Compiling 2 source files to C:\Users\nan.GASTELUM-HP\Desktop\tabla\build\classes
C:\Users\nan.GASTELUM-HP\Desktop\tabla\src\cliente\nan.java:219: error: not a statement
Logger.getLogger(ing_cli.class.getName()).logLevel.SEVERE, null, ex);
C:\Users\nan.GASTELUM-HP\Desktop\tabla\src\cliente\nan.java:219: error: ';' expected
Logger.getLogger(ing_cli.class.getName()).logLevel.SEVERE, null, ex);
C:\Users\nan.GASTELUM-HP\Desktop\tabla\src\cliente\nan.java:219: error: not a statement
Logger.getLogger(ing_cli.class.getName()).logLevel.SEVERE, null, ex);
C:\Users\nan.GASTELUM-HP\Desktop\tabla\src\cliente\nan.java:219: error: ';' expected
Logger.getLogger(ing_cli.class.getName()).logLevel.SEVERE, null, ex);
4 errors
C:\Users\nan.GASTELUM-HP\Desktop\tabla\nbproject\build-impl.xml:413: The following error occurred while executing this line:
C:\Users\nan.GASTELUM-HP\Desktop\tabla\nbproject\build-impl.xml:199: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 4 seconds)




porfavor ayuda¡¡¡¡
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder