miércoles, 1 de octubre de 2014

Programas en Netbeans JAVA

PROGRAMA UNO:

package programauno;


public class Programauno {
 
    public static void main(String[] args) {
             System.out.println("Bienvenidos a Java! !") ;
    }
}



PROGRAMA SUMA Y PRODUCTO:

import java.util.Scanner;
public class Suma {
    public static void main(String[] ar) {
        Scanner teclado=new Scanner(System.in);
        int num1,num2,suma,producto;
        System.out.print("Ingrse primer valor:");
        num1=teclado.nextInt();
        System.out.print("Ingrese segundo valor:");
        num2=teclado.nextInt ();
        suma=num1 + num2;
        producto=num1*num2;
        System.out.print("La suma de dos valores es:");
        System.out.print(suma);
        System.out.print("El producto de los dos valores es:");
        System.out.println(producto);
    }
    

}

PROGRAMA QUE CALCULA EL PERÍMETRO DE UN CUADRADO:

import java.util.Scanner;public class P2 { public static void main (String[]ar) {     Scanner teclado=new Scanner (System.in);     int lado,perimetro;     System.out.print("Ingrese lado del cuadrado:");     lado=teclado.nextInt();     perimetro=lado*4;     System.out.print("El preimetro del cuadrado es:");     System.out.println(perimetro); }}


PROGRAMA QUE CALCULA EL ÁREA DE UN CIRCULO:

import java.util. Scanner;
public class Areacircular {
    public static void main (String[]ar) {
        Scanner teclado=new Scanner(System.in);
        float Area,radio;
        System.out.print("Ingresar el radio:");
        radio=teclado.nextInt();
        Area=4*(radio*radio);
        System.out.print("El area del circulo es:");
        System.out.println(Area);
    }

}


PROGRAMA EN EL CUAL SE INGRESAN 4 NÚMEROS Y SE CALCULA LA SUMA DE LOS DOS PRIMEROS Y EL PRODUCTO:

import java.util.Scanner;
public class numeros4 {
    public static void main (String[]ar) {
        Scanner teclado=new Scanner(System.in);
        int num1,num2,num3,num4,Suma,producto;
        System.out.print("ingrese el primer valor:");
        num1=teclado.nextInt();
        System.out.print("ingrese el segundo valor:");
        num2=teclado.nextInt();
        System.out.print("ingrese el tercer valor:");
        num3=teclado.nextInt();
        System.out.print("ingrese el cuarto valor:");
        num4=teclado.nextInt();
        Suma=num1+num2;
        producto=num3*num4;
        System.out.print("La suma de los valores uno y dos es:");
        System.out.print(Suma);
        System.out.print("El producto de los valores tres y cuatro:");
        System.out.println(producto);
    }
    

}


PROGRAMA QUE DE 4 VALORES NUMÉRICOS IMPRIME SU SUMA Y PROMEDIO:

import java.util.Scanner;
public class sumaypromedio {
    public static void main (String []ar){
        Scanner teclado=new Scanner(System.in);
        int valor1,valor2,valor3,valor4,suma,promedio;
        System.out.print("ingrese el primer valor");
        valor1=teclado.nextInt();
        System.out.print("ingrese el segundo valor:");
        valor2=teclado.nextInt();
        System.out.print("ingrese el tecer valor:");
        valor3=teclado.nextInt();
        System.out.print("ingrese el cuarto valor:");
        valor4=teclado.nextInt();
        suma=valor1+valor2+valor3+valor4;
        promedio=suma/4;
        System.out.print("La suma de los cuatro valores es:");
        System.out.print(suma);
        System.out.print("El producto de la division es:");
        System.out.println(promedio);
    }
        

}

PROGRAMA QUE INGRESA EL PRECIO DE UN ARTICULO, LA CANTIDAD DE ARTÍCULOS QUE LLEVA EL CLIENTE Y MUESTRA LO QUE DEBE PAGAR:

import java.util.Scanner;
public class Articulos {
    public static void main (String[]ar){
        Scanner teclado=new Scanner(System.in);
        float pagar, cantidad, precio;
        System.out.print("Ingrese la cantidad de articulos:");
        cantidad=teclado.nextInt();
        System.out.print("Ingrese el precio del articulo:");
        precio=teclado.nextFloat();
        pagar=cantidad*precio;
        System.out.print("El total a pagar es:");
        System.out.println(pagar);
        
    }
    
}


PROGRAMA QUE INGRESA EL SUELDO PARA SABER SI SE DEBE ABONAR IMPUESTOS:

import java.util.Scanner;
public class sueldo {
    public static void main (String[] ar) {
        Scanner teclado=new Scanner(System.in);
        float sueldo;
        System.out.print("Ingrese el sueldo:");
        sueldo=teclado.nextFloat();
        if (sueldo>3000) {
            System.out.println("Esta persona debe abonar impuesto:");
        }
    }
    

}

PROGRAMA QUE INGRESA EL SUELDO PARA SABER SI SE DEBE ABONAR IMPUESTOS: (ELSE)

import java.util.Scanner;
public class sueldoelse {
    public static void main (String[] ar) {
        Scanner teclado=new Scanner(System.in);
        float sueldo;
        System.out.print("Ingrese el sueldo:");
        sueldo=teclado.nextFloat();
        if (sueldo>3000) {
        System.out.print("Esta persona debe abonar impuesto:");
        }
        else
        System.out.println("Esta persona no debe abonar impuestos:");
        }
        

    }

PROGRAMA QUE LEA 2 VALORES Y DECIDA CUAL ES EL MAYOR:

import java.util.Scanner;
public class valoressimple {
    public static void main (String[]ar) {
    Scanner teclado=new Scanner(System.in);
    int num1,num2;
    System.out.print("Ingrese el primer valor:");
    num1=teclado.nextInt();
    System.out.print("Ingrese el segundo valor:");
    num2=teclado.nextInt();
    if (num1>num2) {
        System.out.print("El número mayor es num1:");
    }
    else
        System.out.println("El número mayor es num2:");
    }

}

PROGRAMA QUE LEA 2 VALORES, SI EL PRIMERO ES MAYOR QUE CALCULE LA SUMA Y RESTA DE AMBOS, SI EL SEGUNDO ES MAYOR QUE CALCULE EL PRODUCTO Y DIVISIÓN:

import java.util.Scanner;
public class Nummayor {
    public static void main (String[]ar) {
       Scanner teclado=new Scanner(System.in);
       int num1,num2,total1,total2;
       System.out.print("Ingrese el primer número:");
       num1=teclado.nextInt();
       System.out.print("Ingrese el segundo número:");
       num2=teclado.nextInt();
       if (num1>num2) {
       total1=num1+num2;
       System.out.print("La suma de los valores es:");
       System.out.print(total1);
       total2=num1-num2;
       System.out.print("La resta de los valores es:");
       System.out.print(total2);
       }
       else
       {
       total1=num1*num2;
       System.out.print("El producto de los valores es:");
       System.out.print(total1);
       total2=num1/num2;
       System.out.print("La división de los valores es:");
       System.out.println(total2);
       }
    }
    }

PROGRAMA QUE PERMITA LEER LAS TRES CALIFICACIONES DE UN ALUMNO, QUE REALICE EL PROMEDIO Y QUE DETERMINE SI ES MAYOR O IGUAL A 9 IMPRIMIR "EXENTO", SI ES MAYOR 9 Y MENOR QUE 6 IMPRIMIR "REGULAR", Y SI ES MENOR QUE 6 IMPRIMIR "REPROBADO":

Import java.util.Scanner;
public class Calificaciones{
public static void main(String[]ar){
Scanner teclado=new Scanner (System.in);
Float cal1, cal2, cal3, Prom;
System.out.print("Ingresa la primer calificación:");
cla1=teclado.nextFloat();

System.out.print("Ingresa la segunda calificación:");
cal2=teclado.nextFloat();

System.out.print("Ingresa la tercer calificación:");
cal3=teclado.nextFloat();
Prom=cal1+cal2+cal3/3;
if (Prom>=9){
System.out.println(exento);
}
else
{
if (Prom<9 && Prom>6);
System.out.println(Regular);
}
else
{
System.out.println(Reprobado):
}
}
}

PROGRAMA QUE PERMITE PREGUNTAR UN NÚMERO ENTERO POSITIVO DE HASTA TRES CIFRAS Y QUE MUESTRA UN MENSAJE INDICANDO SI TIENE 1, 2, O 3 CIFRAS. MUESTRA UN MENSAJE DE ERROR SI EL NÚMERO DE CIFRAS ES MAYOR:

Import java.util.Scanner;
public class Cifras{
public class static void main (String[]ar){
Scannerteclado=new Scanner (System.in);
Int num;
System.out.print("Ingresa el número:");
num=teclado.nextInt();
if (num>0 && num<9){
System.out.println("Tiene dos cifras");
}
else
{
if (num>9 && num<99){
System..out.println("Tiene 2 cifras");
}
}
else
{
if (num>99 && num<999){
System.out.println("Tiene 3 cifras");
}
else
{
System.out.println("El número de cifras es mayor");
}

PROGRAMA QUE SOLICITA INTRODUCIR UN NÚMERO POSITIVO Y QUE DESPLIEGUE EN PANTALLA DESDE EL 1 HASTA EL VALOR INGRESADO DE 1 EN 1:

Import java.util.Scanner;
public class Números{
public static void main (String[]ar){
Scanner teclado=new Scanner (System.in);
Int Num, X;
System.out.print("Ingrese el valor:");
Num=teclado.nextInt();

X=0;
while (X<Num) 
{
X=X+1;
System.out.println(X);
}
}
}

PROGRAMA QUE PERMITE LEER 10 VALORES Y LOS MUESTRA POSTERIORMENTE LA SUMA DE LOS VALORES INGRESADOS Y SU PROMEDIO:

Import java.util.Scanner:
public class Valores10{
public static void main (String[]ar){
Scanner teclado=new Scanner(System.in);
Float suma, prom, valor, A;
while (A<10) 
{
System.out.println(valor);
valor=teclado.nextFloat();
suma=(valor+suma);
A+1;
}
prom=valor/10;
System.out.print("El promedio es:");
System.out.println(prom);
}
}

EN UNA PLANTA QUE FABRICA PERFILES DE HIERRO POSEEN UN LOTE DE n PIEZAS. PROGRAMA QUE PERITE INGRESAR POR EL TECLADO LA CANTIDAD DE PIEZAS A PROCESAR Y QUE PREGUNTA LA LONGITUD DE CADA PERFIL DE HIERRO, CONTANDO SOLAMENTE LAS QUE MIDAN ENTRE 1.20 Y 1.30m. IMPRIME EN PANTALLA LA CANTIDAD DE PIEZAS QUE ESTÁN DENTRO DEL RANGO:

Import java.util.Scanner;
public class Longitudes{
public static void main (String[]ar){
Scanner teclado=new Scanner(System.in);
Float c, n, L, suma;
n=0;
suma=0;
System.out.print("Ingrese cantidad de piezas:");
c=teclado.nextFloat();
while(n<c){
System.out.print("Ingresar longitud:");
L=teclado.nextFloat();
n=n+1;
if(L>1.20 && L<1.30){

suma=suma+1;
}
System.out.print("Las piezas son:");
System.out.println(suma);
}
}
}

PROGRAMA QUE PERMITE INGRESAR UN NÚMERO DE ALTURA DE PERSONAS Y DESPLIEGA EL PROMEDIO DE LAS ALTURAS:

Import java.util.Scanner;
public class Alturas{
public static void main(String[]ar){
Scanner teclado=new Scanner(System.in);
Float n, A, B, C, T;
System.out.print("Ingrese cantidad de alturas:");
n=teclado.nextFloat();
C=0;
for (A=0; A<n; A=A+1;){
System.out.print("Ingrese la altura de las personas:");
B=teclado.nextFloat();
C=C+B;
}
System.out,print("El promedio de las alturas es:");
Syste,.out.println(T);
}
}

EN UNA EMPRESA TRABAJAN n EMPLEADOS CUYO SUELDO OSCILA ENTRE 100 Y 500. PROGRAMA QUE LEE LOS SUELDOS QUE COBRA CADA EMPLEADO, INFORMA CUANTOS EMPLEADOS COBRAN ENTRE 100 Y 300 Y CUANTOS COBRAN MÁS DE 300, ADEMÁS EL PROGRAMA INFORMARÁ EL IMPORTE QUE GASTA LA EMPRESA EN SUELDOS DE PERSONAL:

Import java.util.Scanner;
public class Empresa{
public static void main (String[]ar){
Scanner teclado=new Scanner(System.in);
Int n, A, cont1; cont2;
Float sueldo, gastos;
System.out.print("Ingrese el número de empleados:");
n=teclado.nextInt();
A=1;
cont1=0;
cont2=0;
gastos=0;
while (A<=n){
System.out.print("Ingresar el sueldo del empleado:");
sueldo=teclado.nextFloat();
if (sueldo <=300){
cont1=cont1+1;
}
else
{
if (sueldo>300) {
cont2=cont2+1;
}
System.out.print("Empleados dentro del rango:");
System.out.println(cont1);
System.out.print("Empleados dentro del rango dos:");
System.out.println(cont2);
System.out.print("Gastos de la empresa:");
System.out.println(gastos);
}
}
}

PROGRAMA QUE IMPRIME LOS PRIMEROS 25 NÚMEROS DE LA SERIE 11, 22, 33, 44, ETC. (LOS NÚMEROS NO SE INGRESAN POR TECLADO):

public class Serie11{
public static void main (String[]ar){
Int X, num;
num=11;
while (X<=25){
System.out.print(num);
System.out.print("_");
X=X+1;
num=num+11;
}
}
}


PROGRAMA 21 QUE CALCULA LA EDAD DE DOS PERSONAS E IMPRIME LA MAYOR: 

import java.util.Scanner;

public class Edades {
public static void main(String[]ar){
Scanner teclado=new Scanner(System.in);
String nombre1, nombre2;
int edad1, edad2;
System.out.print("Ingrese el primer nombre:");
nombre1=teclado.next();
System.out.print("Ingrese la primer edad:");
edad1=teclado.nextInt();
System.out.print("Ingrese el segundo nombre:");
nombre2=teclado.next();
System.out.print("Ingrese la segunda edad:");
edad2=teclado.nextInt();
System.out.println("La persona de mayor edad es:");
if (edad1>edad2){
    System.out.print(nombre1);
}
else {
    System.out.print(nombre2);
}

}

}


PROGRAMA 22 QUE GUARDA LOS SUELDOS DE 5 EMPLEADOS (PRUEBA VECTOR):

import java.util.Scanner;
public class PruebaVector {
private Scanner teclado;
private int [] sueldo;
public void cargar()
{
teclado=new Scanner(System.in);
sueldo=new int[5];
for (int f=0; f<5; f++){
System.out.print("Ingrese el sueldo:");
sueldo[f]=teclado.nextInt();
}
}
public void imprimir(){
for (int f=0; f<5; f++){
System.out.println(sueldo[f]);
}
}
public static void main (String[]ar){
PruebaVector pv=new PruebaVector();
pv.cargar();
pv.imprimir();
}

}


PROGRAMA 23 QUE DEFINE UN VECTOR DE TAMAÑO 5 Y DE TIPO FLOAT QUE REPRESENTE LAS ALTURAS DE 5 PERSONAS Y OBTIENE EL PROMEDIO DE LAS MISMAS, Y CUENTA CUANTAS PERSONAS SON MÁS ALTAS QUE EL PROMEDIO Y CUANTAS SON MÁS BAJAS:

import java.util.Scanner;
public class Alturas5 {
private Scanner teclado;
private float[]alturas; float prom,altura=0,AB=0,AR=0;
public void cargar()
{
teclado=new Scanner(System.in);
alturas=new float[5];
for (int f=0; f<5; f++){
System.out.print("Ingrese las alturas:");
alturas[f]=teclado.nextFloat();
altura=altura+alturas[f];
}
}
public void promedio(){
prom=altura/5;
System.out.print("El promedio de las alturas es:");
System.out.println(prom);
}
public void mayormenor (){
for (int f=0; f<5; f=f+1){
if (alturas[f]<=prom){
AB=AB+1;
}
else {
    AR=AR+1;
}
}
System.out.print("Personas que están debajo del promedio son:");
System.out.println(AB);
System.out.print("Personas que están arriba del promedio son:");
System.out.println(AR);
}
public static void main(String[]ar){
Alturas5 pv=new Alturas5();
pv. cargar();
pv.promedio();
pv.mayormenor();
}

}

UNA EMPRESA TIENE DOS TURNOS (MAÑANA Y TARDE) EN LOS QUE TRABAJAN 8 EMPLEADOS (4 POR LA MAÑANA Y 4 POR LA TARDE). PROGRAMA QUE PERMITE ALMACENAR LOS SUELDOS DE LOS EMPLEADOS AGRUPADOS POR TURNOS. IMPRIME LOS GASTOS EN LOS SUELDOS DE CADA TURNO:

import java.util.Scanner;
public class Turnos {
    private Scanner teclado;
    private float[]EmpleadosM;float SM=0,ST=0;int x;
    private float[]EmpleadosT;
    public void cargar(){
        teclado=new Scanner(System.in);
        EmpleadosM=new float[4];
        EmpleadosT=new float[4];
       for(int y=0;y<2;y++){
        System.out.print("Ingrese el numero 1 si pertenece al turno matutino o el numero 2 si pertenece al vespertino:");
        x=teclado.nextInt();
        if (x<2){
        for(int f=0;f<4;f=f+1){
            System.out.print("Ingrese el sueldo del empleado  de la mañana:");
            EmpleadosM[f]=teclado.nextFloat();
            SM=SM+EmpleadosM[f];
           
        }
    }
        else{
            for(int f=0;f<4;f++){
           System.out.print("Ingrese el sueldo del empleado  de la tarde:");
           EmpleadosT[f]=teclado.nextFloat();
            ST=ST+EmpleadosT[f];
            }
        }}}
    public void imprimir(){
        System.out.println("El gasto en sueldos de la mañana es:"+SM);
        System.out.println("El gasto en sueldos de la tarde es:"+ST);
    }
    public static void main(String[]ar){
       Turnos e=new Turnos();
        e.cargar();
        e.imprimir();
    }

}

PROGRAMA 25 QUE CALCULA LAS CALIFICACIONES DEL PRIMER PARCIAL DE LOS ALUMNOS DE 2 MATERIAS, LA MATERIA B Y LA MATERIA A CADA MATERIA CUENTA CON 5 ALUMNOS. Y SE MUESTRA LA MATERIA CON EL MAYOR PROMEDIO GENERAL:

import java.util.Scanner;

public class Primerparcial {
    private Scanner teclado;
    private int[] A;
    private int[] B;
    
    public void cargar() {
        teclado=new Scanner(System.in);
        A=new int[5];
        B=new int[5];
        System.out.println("Calificaciones de la materia A:");
        for(int f=0;f<5;f++) {
            System.out.print("Ingrese calificaciones:");
            A[f]=teclado.nextInt();
        }
        System.out.println("Calificaciones de la materia B:");
        for(int f=0;f<5;f++) {
            System.out.print("Ingrese calificaciones:");
           B[f]=teclado.nextInt();
        }        
    }    
    
    public void calcularPromedios() {
        int suma1=0;
        int suma2=0;
        for(int f=0;f<5;f++) {
            suma1=suma1+A[f];
            suma2=suma2+B[f];            
        }
        int promedioa=suma1/5;
        int promediob=suma2/5;
        if (promedioa>promediob) {
            System.out.println("La materia A tiene un promedio mayor.");
        } else {
            System.out.println("La materia B tiene un promedio mayor.");
        }
    }
    
    public static void main(String[] ar) {
        Primerparcial pv=new Primerparcial();
        pv.cargar();
        pv.calcularPromedios();
    }    

}


PROGRAMA 27: CONTADOR DE VOCALES.





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

/**
 *
 * @author Cbtis73
 */
public class ContadorVocales extends javax.swing.JFrame {
void aceptar(){
String texto;
int x;
texto=txtCuenta.getText();
int cuentavocales=0;
for (x=0; x<texto.length(); x++){
    if ((texto.charAt(x)=='a')||
            (texto.charAt(x)=='e')||
            (texto.charAt(x)=='i')||
            (texto.charAt(x)=='o')||
            (texto.charAt(x)=='u')){
        cuentavocales++;
    }
}
lblRespuesta.setText("El texto"+"'"+ texto +"'"+" contiene " + cuentavocales + "vocales");

}
void limpiar(){
    txtCuenta.setText("");
    lblRespuesta.setText("");
}
    /**
     * Creates new form Vocales
     */
    public ContadorVocales() {
        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")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jTextField1 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtCuenta = new javax.swing.JTextField();
        bntAceptar = new javax.swing.JButton();
        btnNuevo = new javax.swing.JButton();
        lblRespuesta = new javax.swing.JLabel();

        jTextField1.setText("jTextField1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Verdana", 1, 18)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(204, 0, 0));
        jLabel1.setText("CONTADOR DE VOCALES");

        jLabel2.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 153, 204));
        jLabel2.setText("Ingrese texto");

        txtCuenta.setForeground(new java.awt.Color(153, 153, 153));
        txtCuenta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCuentaActionPerformed(evt);
            }
        });

        bntAceptar.setText("ACEPTAR");
        bntAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntAceptarActionPerformed(evt);
            }
        });

        btnNuevo.setText("NUEVO");
        btnNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoActionPerformed(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(212, 212, 212)
                        .addComponent(bntAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnNuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 296, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtCuenta, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(lblRespuesta, javax.swing.GroupLayout.PREFERRED_SIZE, 238, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtCuenta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bntAceptar)
                    .addComponent(btnNuevo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(lblRespuesta, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(34, 34, 34))
        );

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

    private void txtCuentaActionPerformed(java.awt.event.ActionEvent evt) {                                          
              // TODO add your handling code here:
    }                                         

    private void bntAceptarActionPerformed(java.awt.event.ActionEvent evt) {                                           
     aceptar();  // TODO add your handling code here:
    }                                          

    private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {                                         
    limpiar();             // 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(ContadorVocales.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ContadorVocales.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ContadorVocales.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ContadorVocales.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 ContadorVocales().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify                     
    private javax.swing.JButton bntAceptar;
    private javax.swing.JButton btnNuevo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JLabel lblRespuesta;
    private javax.swing.JTextField txtCuenta;
    // End of variables declaration                   
}



No hay comentarios.:

Publicar un comentario