Credencial

Credencial

import java.awt.Font;

import java.awt.Color;

 

@SuppressWarnings("serial")

public class Credencial extends javax.swing.JFrame{

 

//VARIBLES PARA DEFINIR ETIQUETAS

                               javax.swing.JLabel sep,escuela,cetis,nombre,apellidos,curp,carrera,sems,dgeti;

//VARIABLES PARA DEFINIR CAMPOS DE TEXTO

                               javax.swing.JTextField tnombre,tapellidos,tcurp,tcarrera;

                              

                               public Credencial(){

                                               setSize(500,350);

                                               setTitle("CREDENCIAL");

//CAMBIAR COLOR DE VENTANA

                                               getContentPane().setBackground(Color.yellow);

//DEFINICION DE LAS EIQUETAS      

                                               sep = new javax.swing.JLabel();

                                               escuela = new javax.swing.JLabel();

                                               cetis = new javax.swing.JLabel();

                                               nombre = new javax.swing.JLabel();

                                               apellidos = new javax.swing.JLabel();

                                               curp = new javax.swing.JLabel();

                                               carrera = new javax.swing.JLabel();

                                               sems = new javax.swing.JLabel();

                                               dgeti = new javax.swing.JLabel();

//DEFINICION DE LOS CAMPOS DE TEXTO                                    

                                               tnombre = new javax.swing.JTextField();

                                               tapellidos = new javax.swing.JTextField();

                                               tcurp = new javax.swing.JTextField();

                                               tcarrera = new javax.swing.JTextField();

//SE DETERMINA LO QUE LLEVARA LA VENTANA

                                               getContentPane().setLayout(null);

                                              

                                               sep.setText("SEP");

                                               getContentPane().add(sep);

                                               escuela.setText("CETis 50");

                                               getContentPane().add(escuela);

                                               cetis.setText("\"Mariano Matamoros Guridi\"");

                                               getContentPane().add(cetis);

                                               nombre.setText("Nombre");

                                               getContentPane().add(nombre);

                                               apellidos.setText("Apellidos");

                                               getContentPane().add(apellidos);

                                               curp.setText("CURP");

                                               getContentPane().add(curp);

                                               carrera.setText("Carrera");

                                               getContentPane().add(carrera);

                                               sems.setText("SEMS");

                                               getContentPane().add(sems);

                                               dgeti.setText("DGETI");

                                               getContentPane().add(dgeti);

                                              

                                               tnombre.setText("CARLOS JAIR");

                                               getContentPane().add(tnombre);

                                               tapellidos.setText("NIETO BARCENAS");

                                               getContentPane().add(tapellidos);

                                               tcurp.setText("NIBC980301HOCTRR03");

                                               getContentPane().add(tcurp);

                                               tcarrera.setText("Bachillerato Tecnologico");

                                               getContentPane().add(tcarrera);

//SE LE PROPORCIONA LA POSICION Y EL ANCHO (COLUMNAS) Y LARGO (FILAS)

                                               sep.setBounds(15,10,50,20);

                                               escuela.setBounds(10,40,250,20);

                                               cetis.setBounds(80,40,250,20);

                                               nombre.setBounds(30,100,250,20);

                                               apellidos.setBounds(30,140,250,20);

                                               curp.setBounds(30,180,250,20);

                                               carrera.setBounds(40,220,250,20);

                                               sems.setBounds(400,110,50,20);

                                               dgeti.setBounds(400,190,50,20);

                                              

                                               tnombre.setBounds(50,120,150,20);

                                               tapellidos.setBounds(50,160,150,20);

                                               tcurp.setBounds(50,200,150,20);

                                               tcarrera.setBounds(50,240,150,20);                                            

//CAMBIAR TIPO DE FUENTE Y TAMAÑO, NOMBRE DE VARIABLE                                           

                                               sep.setFont(new Font(null,Font.BOLD,15));

                                               cetis.setFont(new Font(null,Font.PLAIN,12));

                                               carrera.setFont(new Font("Verdana",1,10));

                                               sems.setFont(new Font(null,Font.BOLD,15));

                                               dgeti.setFont(new Font(null,Font.PLAIN,15));

                                              

                                               tnombre.setFont(new Font(null,Font.ITALIC,12));

                                               tapellidos.setFont(new Font(null,Font.ITALIC,12));

                                               tcurp.setFont(new Font(null,Font.ITALIC,12));

                                               tcarrera.setFont(new Font(null,Font.ITALIC,12));                                       

//CAMBIAR COLOR DEL TEXTO                                       

                                               sep.setForeground(Color.gray);

                                               dgeti.setForeground(Color.blue);

                                              

                                               tnombre.setForeground(Color.gray);

                                               tapellidos.setForeground(Color.gray);

                                               tcurp.setForeground(Color.gray);

                                               tcarrera.setForeground(Color.gray);

                               }

                               public static void main(String[] args) {

                                               new Credencial().setVisible(true);

                               }

                }