ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Programa para la realización del Examen de Métodos Numéricos de forma teórica


Enviado por   •  16 de Agosto de 2015  •  Tareas  •  10.218 Palabras (41 Páginas)  •  169 Visitas

Página 1 de 41

Programa para la realización del Examen de Métodos Numéricos de forma teórica

Para la realización de este programa se utilizó la plataforma de Netbeans para el uso del lenguaje Java.

Codificación del Programa:

Paquete fuente del  programa:

package examenmetodos;        

import javax.swing.JOptionPane;

public class data {

    public data(){    

    }    

Declaración de las variables para los datos del alumno

    Integer matricula = 0;

    String nombre = "";

    double salon = 0;

    String hora = "";

Código para capturar los datos del alumno

   

public void capturaDatos(){                        

    nombre = prueba1.nombre.getText();

    matricula = Integer.parseInt(prueba1.matricula.getText());

    salon = Double.parseDouble(prueba1.salon.getText());

    hora = prueba1.hora.getText();

    }

}

Ventana principal

[pic 1]

package examenmetodos;

import javax.swing.JOptionPane;

public class prueba1 extends javax.swing.JFrame {

        public prueba1() {

        initComponents();

    }

Se instancia la clase data:

    data datos = new data();

   

Código para generar la ventana con sus botones y áreas de texto

    @SuppressWarnings("unchecked")

    //                          

    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();

        jLabel2 = new javax.swing.JLabel();

        jLabel3 = new javax.swing.JLabel();

        jLabel4 = new javax.swing.JLabel();

        jLabel5 = new javax.swing.JLabel();

        jLabel6 = new javax.swing.JLabel();

        nombre = new javax.swing.JTextField();

        matricula = new javax.swing.JTextField();

        salon = new javax.swing.JTextField();

        hora = new javax.swing.JTextField();

        iniciar = new javax.swing.JButton();

        salir = new javax.swing.JButton();

        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N

        jLabel1.setText("Universidad Autónoma de Nuevo León");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N

        jLabel2.setText("Facultad de Ingeniería Mecánica y Eléctrica");

        jLabel3.setText("Nombre");

        jLabel4.setText("Matricula");

        jLabel5.setText("Salón");

        jLabel6.setText("Hora");

        iniciar.setText("Iniciar");

        iniciar.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {

                iniciarActionPerformed(evt);

            }

        });

        salir.setText("salir");

        salir.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {

                salirActionPerformed(evt);

            }

        });

        jButton1.setText("Consultar");

        jButton1.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {

                jButton1ActionPerformed(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.LEADING)

                    .addGroup(layout.createSequentialGroup()

                        .addGap(75, 75, 75)

                        .addComponent(jLabel1))

                    .addGroup(layout.createSequentialGroup()

                        .addGap(62, 62, 62)

                        .addComponent(jLabel2))

                    .addGroup(layout.createSequentialGroup()

                        .addGap(34, 34, 34)

                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

                            .addGroup(layout.createSequentialGroup()

                                .addComponent(jLabel3)

                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

                                .addComponent(nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 261, javax.swing.GroupLayout.PREFERRED_SIZE))

...

Descargar como (para miembros actualizados)  txt (45.2 Kb)   pdf (264.4 Kb)   docx (73.4 Kb)  
Leer 40 páginas más »
Disponible sólo en Clubensayos.com