Java - Formulario Jframe en Java Ayuda con codigo

 
Vista:
Imágen de perfil de JennAnn

Formulario Jframe en Java Ayuda con codigo

Publicado por JennAnn (23 intervenciones) el 04/11/2015 06:09:35
Hola, si me pudieran ayudar a que arranque bien mi programa, ya tengo la mayor parte del codigo del formulario para registrar quienes an votado, pero ya no se que mas codigos se ponen para que todos los espacios en escribir y bonones me funciones, me pueden decir que mas me falta para que me corra bien? porfavor, se los agredeceria mucho. (este es el codigo)

NOTA: no me sirve el boton de guardar, tampoco se como generar la curp y validarla para que me aparesca hay y al escribir en los espacios en blanco aun nose validar las letras o numeros.

********Dejo IMAGENES DE LOS CUADROS.*********


--------------------------CLASE MAIN PRINCIPAL---------------------------

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
import javax.swing.JInternalFrame;
 
public class Principal extends javax.swing.JFrame {
    public static
 
    Logotipo f = new Logotipo();
    TeoriaComputacion  a = new TeoriaComputacion();
 
protected void crearventana(){
    JInternalFrame ventana=new JInternalFrame("Registro", true, true, true, true);
    ventana.getContentPane().add(a);
    ventana.setSize(700,800);
    ventana.show();
    Desktop.add(ventana);
}
 
    public Principal() {
        initComponents();
    }
 
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
    crearventana();
 
    }
 
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
/* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Principal().setVisible(true);
            }
        });
    }
 
    // Variables declaration - do not modify
    private javax.swing.JDesktopPane Desktop;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
 
}

---------------- CLASE MAIN FORMULARIO -------------------

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
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
public class TeoriaComputacion extends javax.swing.JPanel {
 
public TeoriaComputacion() {
        initComponents();
             Grupo.add(Femenino);
             Grupo.add(Masculino);
    }
    public void letras(String cadena){
        Pattern patron=Pattern.compile("{a-zA-Z}+");
        Matcher m=patron.matcher(cadena);
        if (m.find())
 
    }
 
@SuppressWarnings("unchecked")
 
    private void txtPasswordActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }
 
    private void jPanel3ComponentShown(java.awt.event.ComponentEvent evt) {
      // TODO add your handling code here:
    }
 
    private void MasculinoActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }
 
    private void txtApellidoPaternoActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }
 
    private void btnGuardarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }
 
    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {
    System.exit(0);        // TODO add your handling code here:
    }
 
    private void DiaActionPerformed(java.awt.event.ActionEvent evt) {
     Dia.getSelectedItem();        // TODO add your handling code here:
    }
 
    private void MesActionPerformed(java.awt.event.ActionEvent evt) {
     Mes.getSelectedItem();        // TODO add your handling code here:
    }
 
    private void AñoActionPerformed(java.awt.event.ActionEvent evt) {
     Año.getSelectedItem();        // TODO add your handling code here:
    }
 
    private void EstadoActionPerformed(java.awt.event.ActionEvent evt) {
     Estado.getSelectedItem();        // TODO add your handling code here:
    }
 
 
    // Variables declaration - do not modify
    private javax.swing.JComboBox Año;
    private javax.swing.JComboBox Dia;
    private javax.swing.JComboBox Estado;
    public static javax.swing.JRadioButton Femenino;
    private javax.swing.ButtonGroup Grupo;
    public static javax.swing.JRadioButton Masculino;
    private javax.swing.JComboBox Mes;
    private javax.swing.JButton btnGenerar;
    private javax.swing.JButton btnGuardar;
    private javax.swing.JButton btnSalir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JTextField txtApellidoMaterno;
    private javax.swing.JTextField txtApellidoPaterno;
    private javax.swing.JTextField txtCurp;
    private javax.swing.JTextField txtNControl;
    private javax.swing.JTextField txtNombres;
    private javax.swing.JPasswordField txtPassword;
    private javax.swing.JTextField txtUsuario;
    // End of variables declaration
}

--------------------------------------CLASE MAIN INICIO SESION----------------------------------

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
public class Logotipo extends javax.swing.JPanel {
 
public Logotipo() {
        initComponents();
    }
 
@SuppressWarnings("unchecked")
 
private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {
     System.exit(0);         // TODO add your handling code here:
    }
 
    private void btnAceptarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }
 
    private void txtPasswordActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }
 
    private void txtUsuarioActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }
 
 
    // Variables declaration - do not modify
    private javax.swing.JButton btnAceptar;
    private javax.swing.JButton btnSalir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField txtPassword;
    private javax.swing.JTextField txtUsuario;
    // End of variables declaration
}

clase-principal

Clase-formulario

Clase-Inicio-Sesion
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

Formulario Jframe en Java Ayuda con codigo

Publicado por Renzo (232 intervenciones) el 04/11/2015 15:36:07
Hola
ayudaría que adjuntes tu proyecto avanzado, a fin de ejecutarlo.

Renzo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de JennAnn

Formulario Jframe en Java Ayuda con codigo

Publicado por JennAnn (23 intervenciones) el 05/11/2015 04:46:53
como que avanzado? de hay ya no se que mas le hace falta
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil
Val: 87
Ha aumentado su posición en 2 puestos en Java (en relación al último mes)
Gráfica de Java

Formulario Jframe en Java Ayuda con codigo

Publicado por Tomas (76 intervenciones) el 05/11/2015 23:52:20
Intente ejecutarlo pero falta el metodo "initComponents". no lo tenes definido en ninguna clase de las de arriba.
Por si te sirve:
Yo uso eclipse,
- la vista preliminar(preview) funciona mal a veces, por eso siempre que quieras comprobar como te va quedando, ejecutalo.
-al usar el windowsBuilder, de vez en cuando te genera codigo basura, es decir, cuando editas muchas veces los tamaños y tal, a veces se repiten, poreso siempre tenes que mirar el codigo y ver que este correcto. Haciendo dobre click sobre el elemento te lleva al codigo.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar