datos_Color
package Repaso;
import java.awt.Color;
import java.awt.Font;
import javax.swing.*;
@SuppressWarnings("serial")
public class datos_Color extends JFrame {
private JLabel nombreL, paternoL, maternoL, gradoL, grupoL, plantelL, materiaL, profesorL, turnoL;
private JTextField nombreT, paternoT, maternoT, gradoT, grupoT, plantelT, materiaT, profesorT, turnoT;
Font f1 = new Font("Comic Sans MS",Font.ITALIC, 15);
Font f2 = new Font("Comic Sans MS",Font.ROMAN_BASELINE, 15);
public datos_Color() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(750,250);
setTitle("Ventana datos personales");
getContentPane().setBackground(Color.white);
nombreL = new JLabel();
paternoL = new JLabel();
maternoL = new JLabel();
gradoL = new JLabel();
grupoL = new JLabel();
plantelL = new JLabel();
materiaL = new JLabel();
profesorL = new JLabel();
turnoL = new JLabel();
nombreT = new JTextField();
paternoT = new JTextField();
maternoT = new JTextField();
gradoT = new JTextField();
grupoT = new JTextField();
plantelT = new JTextField();
materiaT = new JTextField();
profesorT = new JTextField();
turnoT = new JTextField();
nombreL.setText("Nombre:");
paternoL.setText("Apellido Paterno:");
maternoL.setText("Apellido Materno:");
gradoL.setText("Grado:");
grupoL.setText("Grupo:");
plantelL.setText("Plantel:");
materiaL.setText("materia:");
profesorL.setText("profesor:");
turnoL.setText("turno:");
nombreT.setText("Dylan");
paternoT.setText("Cueto");
maternoT.setText("Garduño");
gradoT.setText("3°");
grupoT.setText("\"D\"");
plantelT.setText("Cetis 50 \"Mariano Matamoros Guridi\"");
materiaT.setText("Desarrolla software de aplicación utilizando programación orientada a objetos");
profesorT.setText("Javier Galvez Coronado");
turnoT.setText("Matutino");
getContentPane().setLayout(null);
nombreL.setBounds(15,20,250,20);
nombreT.setBounds(140,20,70,20);
paternoL.setBounds(15,50,250,20);
paternoT.setBounds(140,50,70,20);
maternoL.setBounds(15,80,250,20);
maternoT.setBounds(140,80,70,20);
gradoL.setBounds(260,20,50,20);
gradoT.setBounds(320,20,30,20);
grupoL.setBounds(360,20,50,20);
grupoT.setBounds(420,20,30,20);
plantelL.setBounds(260,50,250,20);
plantelT.setBounds(320,50,280,20);
materiaL.setBounds(100,120,250,20);
materiaT.setBounds(160,120,550,20);
profesorL.setBounds(100,160,250,20);
profesorT.setBounds(160,160,250,20);
turnoL.setBounds(100,190,250,20);
turnoT.setBounds(160,190,250,20);
nombreL.setFont(f1);
nombreT.setFont(f2);
paternoL.setFont(f1);
paternoT.setFont(f2);
maternoL.setFont(f1);
maternoT.setFont(f2);
gradoL.setFont(f1);
gradoT.setFont(f2);
grupoL.setFont(f1);
grupoT.setFont(f2);
plantelL.setFont(f1);
plantelT.setFont(f2);
materiaL.setFont(f1);
materiaT.setFont(f2);
profesorL.setFont(f1);
profesorT.setFont(f2);
turnoL.setFont(f1);
turnoT.setFont(f2);
nombreL.setForeground(Color.RED);
nombreT.setForeground(Color.PINK);
paternoL.setForeground(Color.RED);
paternoT.setForeground(Color.PINK);
maternoL.setForeground(Color.RED);
maternoT.setForeground(Color.PINK);
gradoL.setForeground(Color.RED);
gradoT.setForeground(Color.PINK);
grupoL.setForeground(Color.RED);
grupoT.setForeground(Color.PINK);
plantelL.setForeground(Color.RED);
plantelT.setForeground(Color.PINK);
materiaL.setForeground(Color.RED);
materiaT.setForeground(Color.PINK);
profesorL.setForeground(Color.RED);
profesorT.setForeground(Color.PINK);
turnoL.setForeground(Color.RED);
turnoT.setForeground(Color.PINK);
getContentPane().add(nombreL);
getContentPane().add(nombreT);
getContentPane().add(paternoL);
getContentPane().add(paternoT);
getContentPane().add(maternoL);
getContentPane().add(maternoT);
getContentPane().add(gradoL);
getContentPane().add(gradoT);
getContentPane().add(grupoL);
getContentPane().add(grupoT);
getContentPane().add(plantelL);
getContentPane().add(plantelT);
getContentPane().add(materiaL);
getContentPane().add(materiaT);
getContentPane().add(profesorL);
getContentPane().add(profesorT);
getContentPane().add(turnoL);
getContentPane().add(turnoT);
}
public static void main(String[] args){
new datos_Color().setVisible(true);
}
}