Está en la página 1de 43

Programación II sección: A

Nombres y apellidos: Ismar Leonel Cortez Sanchez


Carné: 0901-21-506 Fecha de entrega: 3/08/2022

Tarea #1

Capturas del código del programa.


Ejecución del programa.

• Ingreso del nombre.


• Ingreso del apellido.
• Ingreso del carnet.
• Impresión de las cadenas de texto con diferente tipo de letra, estilo y
tamaño.
/*Las combinaciones pueden ser varias entre 3 tipos de letra, 3 de estilo y 3 de
tamaño
Código de programa

/Ismar Leonel Cortez Sanchez


//0901-21-506
import java.awt.EventQueue;
import java.awt.Font;
import javax.swing.*;

public class EjemploFuentes extends JFrame {

private JPanel contentPane;

/**
* Launch the application.
*/
public static void main(String[] args) {

EventQueue.invokeLater(new Runnable() {
public void run() {
try {
EjemploFuentes frame = new EjemploFuentes();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the frame.
*/
public EjemploFuentes() {

Icon icono1 = new


ImageIcon(EjemploFuentes.class.getResource("source/1.Fuente1.png").getFil
e());
Icon icono2 = new
ImageIcon(EjemploFuentes.class.getResource("source/2.Tipo.png").getFile()
);
Icon icono3 = new
ImageIcon(EjemploFuentes.class.getResource("source/3.Tamanio.png").getFil
e());
Icon icono4 = new
ImageIcon(EjemploFuentes.class.getResource("source/4.Fuente2.png").getFil
e());
Icon icono5 = new
ImageIcon(EjemploFuentes.class.getResource("source/5.Tipo2.png").getFile(
));
Icon icono6 = new
ImageIcon(EjemploFuentes.class.getResource("source/6.Tamanio2.png").getFi
le());
Icon icono7 = new
ImageIcon(EjemploFuentes.class.getResource("source/7.Fuente3.png").getFil
e());
Icon icono8 = new
ImageIcon(EjemploFuentes.class.getResource("source/8.Tipo3.png").getFile(
));
Icon icono9 = new
ImageIcon(EjemploFuentes.class.getResource("source/9.Tamanio3.png").getFi
le());
int opcion=0;
int opcion2=0;
int opcion3=0;
int opcion4=0;
int opcion5=0;
int opcion6=0;
int opcion7=0;
int opcion8=0;
int opcion9=0;
int opcion10=0;
int opcion11=0;
int opcion12=0;
int opcion13=0;
int opcion14=0;
int opcion15=0;
int opcion16=0;
int opcion17=0;
int opcion18=0;
int opcion19=0;
int opcion20=0;
int opcion21=0;
int opcion22=0;
int opcion23=0;
int opcion24=0;

String [] fuentes={"Serif", "SansSerif","Monospaced"};


String [] Estilos={"Plain", "Bold","Italic"};
String [] tamanios={"10", "20","30"};

//Parametros asociados a la ventana


setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setLayout(null);
setContentPane(contentPane);

/*--------------------------Fuente Serif-------------------------
------------------------*/
Font fuente1= new Font("Serif",Font.PLAIN,10);//0-0-0
Font fuente1a= new Font("Serif",Font.PLAIN,20);//0-0-1
Font fuente1b= new Font("Serif",Font.PLAIN,30);//0-0-2

Font fuente2= new Font("Serif",Font.BOLD,10);//0-1-0


Font fuente2a= new Font("Serif",Font.BOLD,20);//0-1-1
Font fuente2b= new Font("Serif",Font.BOLD,30);//0-1-2

Font fuente3= new Font("Serif",Font.ITALIC,10);//0-2-0


Font fuente3a= new Font("Serif",Font.ITALIC,20);//0-2-1
Font fuente3b= new Font("Serif",Font.ITALIC,30);//0-2-2
/*---------------------------------------------------------------
---------------------------*/

/*--------------------------Fuente SansSerif---------------------
----------------------------*/

Font fuente4= new Font("SansSerif",Font.PLAIN,10);//1-0-0


Font fuente4a= new Font("SansSerif",Font.PLAIN,20);//1-0-1
Font fuente4b= new Font("SansSerif",Font.PLAIN,30);//1-0-2

Font fuente5= new Font("SansSerif",Font.BOLD,10);//1-1-0


Font fuente5a= new Font("SansSerif",Font.BOLD,20);//1-1-1
Font fuente5b= new Font("SansSerif",Font.BOLD,30);//1-1-2

Font fuente6= new Font("SansSerif",Font.ITALIC,10);//1-2-0


Font fuente6a= new Font("SansSerif",Font.ITALIC,20);//1-2-1
Font fuente6b= new Font("SansSerif",Font.ITALIC,30);//1-2-2
/*---------------------------------------------------------------
---------------------------*/

/*--------------------------Fuente Monospaced--------------------
-----------------------------*/
Font fuente7= new Font("Monospaced",Font.PLAIN,10);//2-0-0
Font fuente7a= new Font("Monospaced",Font.PLAIN,20);//2-0-1
Font fuente7b= new Font("Monospaced",Font.PLAIN,30);//2-0-2

Font fuente8= new Font("Monospaced",Font.BOLD,10);//2-1-0


Font fuente8a= new Font("Monospaced",Font.BOLD,20);//2-1-1
Font fuente8b= new Font("Monospaced",Font.BOLD,30);//2-1-2

Font fuente9= new Font("Monospaced",Font.ITALIC,10);//2-2-0


Font fuente9a= new Font("Monospaced",Font.ITALIC,20);//2-2-1
Font fuente9b= new Font("Monospaced",Font.ITALIC,30);//2-2-2
/*---------------------------------------------------------------
---------------------------*/

String nombre= JOptionPane.showInputDialog(null,"Ingrese su


nombre");
opcion =JOptionPane.showOptionDialog(null, "Elige la
fuente","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono1,fuentes,"Serif");

//Componentes
switch(opcion) {

case 0:
opcion2 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono2,Estilos,"Plain");
opcion3 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono3,tamanios,"10");

if(opcion2==0 && opcion3==0){


JLabel lblEtiquetaConOtra = new JLabel("Nombre:
"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente1);
contentPane.add(lblEtiquetaConOtra);}

if(opcion2==0 && opcion3==1){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente1a);
contentPane.add(lblEtiquetaConOtra);}

if(opcion2==0 && opcion3==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente1b);
contentPane.add(lblEtiquetaConOtra);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion2==1 && opcion3==0){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente2);
contentPane.add(lblEtiquetaConOtra);}

if(opcion2==1 && opcion3==1){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente2a);
contentPane.add(lblEtiquetaConOtra);}

if(opcion2==1 && opcion3==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente2b);
contentPane.add(lblEtiquetaConOtra);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion2==2 && opcion3==0){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente3);
contentPane.add(lblEtiquetaConOtra);}

if(opcion2==2 && opcion3==1){


JLabel lblEtiquetaConOtra = new JLabel("Nombre:
"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente3a);
contentPane.add(lblEtiquetaConOtra);}

if(opcion2==2 && opcion3==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente3b);
contentPane.add(lblEtiquetaConOtra);}
break;

case 1:
opcion4 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono4,Estilos,"Plain");
opcion5 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono5,tamanios,"10");

if(opcion4==0 && opcion5==0){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente4);
contentPane.add(lblEtiquetaConOtra);}

if(opcion4==0 && opcion5==1){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente4a);
contentPane.add(lblEtiquetaConOtra);}

if(opcion4==0 && opcion5==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente4b);
contentPane.add(lblEtiquetaConOtra);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion4==1 && opcion5==0){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente5);
contentPane.add(lblEtiquetaConOtra);}

if(opcion4==1 && opcion5==1){


JLabel lblEtiquetaConOtra = new JLabel("Nombre:
"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente5a);
contentPane.add(lblEtiquetaConOtra);}

if(opcion4==1 && opcion5==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente5b);
contentPane.add(lblEtiquetaConOtra);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion4==2 && opcion5==0){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente6);
contentPane.add(lblEtiquetaConOtra);}

if(opcion4==2 && opcion5==1){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente6a);
contentPane.add(lblEtiquetaConOtra);}

if(opcion4==2 && opcion5==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente6b);
contentPane.add(lblEtiquetaConOtra);}
break;

case 2:
opcion6 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono6,Estilos,"Plain");
opcion7 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono7,tamanios,"10");

if(opcion6==0 && opcion7==0){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente7);
contentPane.add(lblEtiquetaConOtra);}

if(opcion6==0 && opcion7==1){


JLabel lblEtiquetaConOtra = new JLabel("Nombre:
"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente7a);
contentPane.add(lblEtiquetaConOtra);}

if(opcion6==0 && opcion7==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente7b);
contentPane.add(lblEtiquetaConOtra);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion6==1 && opcion7==0){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente8);
contentPane.add(lblEtiquetaConOtra);}

if(opcion6==1 && opcion7==1){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente8a);
contentPane.add(lblEtiquetaConOtra);}

if(opcion6==1 && opcion7==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente8b);
contentPane.add(lblEtiquetaConOtra);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion6==2 && opcion7==0){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente9);
contentPane.add(lblEtiquetaConOtra);}

if(opcion6==2 && opcion7==1){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente9a);
contentPane.add(lblEtiquetaConOtra);}
if(opcion6==2 && opcion7==2){

JLabel lblEtiquetaConOtra = new JLabel("Nombre:


"+nombre);
lblEtiquetaConOtra.setBounds(56, 49, 350, 36);
lblEtiquetaConOtra.setFont(fuente9b);
contentPane.add(lblEtiquetaConOtra);}
break;
}

String Apellido= JOptionPane.showInputDialog(null,"Ingrese su


Apellido");
opcion8 =JOptionPane.showOptionDialog(null, "Elige la
fuente","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono8,fuentes,"Serif");

switch(opcion8) {

case 0:
opcion9 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono9,Estilos,"Plain");
opcion10 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono1,tamanios,"10");

if(opcion9==0 && opcion10==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente1);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion9==0 && opcion10==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente1a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion9==0 && opcion10==2){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente1b);
contentPane.add(lblEtiquetaConOtra_1);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion9==1 && opcion10==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente2);
contentPane.add(lblEtiquetaConOtra_1);}
if(opcion9==1 && opcion10==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente2a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion9==1 && opcion10==2){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente2b);
contentPane.add(lblEtiquetaConOtra_1);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion9==2 && opcion10==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente3);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion9==2 && opcion10==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente3a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion9==2 && opcion10==2){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente3b);
contentPane.add(lblEtiquetaConOtra_1);}
break;

case 1:
opcion11 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono3,Estilos,"Plain");
opcion12 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono5,tamanios,"10");

if(opcion11==0 && opcion12==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente4);
contentPane.add(lblEtiquetaConOtra_1);}
if(opcion11==0 && opcion12==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente4a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion11==0 && opcion12==2){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente4b);
contentPane.add(lblEtiquetaConOtra_1);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion11==1 && opcion12==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente5);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion11==1 && opcion12==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente5a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion11==1 && opcion12==2){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente5b);
contentPane.add(lblEtiquetaConOtra_1);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion11==2 && opcion12==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente6);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion11==2 && opcion12==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente6a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion11==2 && opcion12==2){

JLabel lblEtiquetaConOtra_1 = new


JLabel("Apellido"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente6b);
contentPane.add(lblEtiquetaConOtra_1);}
break;

case 2:
opcion15 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono6,Estilos,"Plain");
opcion16 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono2,tamanios,"10");

if(opcion15==0 && opcion16==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente7);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion15==0 && opcion16==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente7a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion15==0 && opcion16==2){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente7b);
contentPane.add(lblEtiquetaConOtra_1);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion15==1 && opcion16==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente8);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion15==1 && opcion16==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente8a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion15==1 && opcion16==2){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente8b);
contentPane.add(lblEtiquetaConOtra_1);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion15==2 && opcion16==0){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente9);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion15==2 && opcion16==1){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente9a);
contentPane.add(lblEtiquetaConOtra_1);}

if(opcion15==2 && opcion16==2){

JLabel lblEtiquetaConOtra_1 = new JLabel("Apellido:


"+Apellido);
lblEtiquetaConOtra_1.setBounds(56, 101, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente9b);
contentPane.add(lblEtiquetaConOtra_1);}
break;
}

String Carnet= JOptionPane.showInputDialog(null,"Ingrese su


Carnet");
opcion17 =JOptionPane.showOptionDialog(null, "Elige la
fuente","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono4,fuentes,"Serif");

switch(opcion17) {

case 0:
opcion18 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono8,Estilos,"Plain");
opcion19 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono2,tamanios,"10");

if(opcion18==0 && opcion19==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente1);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion18==0 && opcion19==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente1a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion18==0 && opcion19==2){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente1b);
contentPane.add(lblEtiquetaConOtra_2);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion18==1 && opcion19==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente2);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion18==1 && opcion19==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente2a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion18==1 && opcion19==2){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente2b);
contentPane.add(lblEtiquetaConOtra_2);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion18==2 && opcion19==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente3);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion18==2 && opcion19==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente3a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion18==2 && opcion19==2){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente3b);
contentPane.add(lblEtiquetaConOtra_2);}
break;

case 1:
opcion20 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono1,Estilos,"Plain");
opcion21 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono2,tamanios,"10");

if(opcion20==0 && opcion21==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente4);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion20==0 && opcion21==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente4a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion20==0 && opcion21==2){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente4b);
contentPane.add(lblEtiquetaConOtra_2);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion20==1 && opcion21==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente5);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion20==1 && opcion21==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente5a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion20==1 && opcion21==2){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente5b);
contentPane.add(lblEtiquetaConOtra_2);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion20==2 && opcion21==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente6);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion20==2 && opcion21==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente6a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion20==2 && opcion21==2){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente6b);
contentPane.add(lblEtiquetaConOtra_2);}
break;

case 2:
opcion22 =JOptionPane.showOptionDialog(null, "Elige el
estilo","Elige..",
0,JOptionPane.QUESTION_MESSAGE,icono3,Estilos,"Plain");
opcion23 =JOptionPane.showOptionDialog(null, "Elige el
tamanio","Elige..", 0,JOptionPane.QUESTION_MESSAGE,icono9,tamanios,"10");

if(opcion22==0 && opcion23==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente7);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion22==0 && opcion23==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente7a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion22==0 && opcion23==2){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente7b);
contentPane.add(lblEtiquetaConOtra_2);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion22==1 && opcion23==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente8);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion22==1 && opcion23==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente8a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion22==1 && opcion23==2){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente8b);
contentPane.add(lblEtiquetaConOtra_2);}
/*-------------------------------------------------------
-----------------------------------*/
if(opcion22==2 && opcion23==0){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente9);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion22==2 && opcion23==1){

JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:


"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente9a);
contentPane.add(lblEtiquetaConOtra_2);}

if(opcion22==2 && opcion23==2){


JLabel lblEtiquetaConOtra_2 = new JLabel("Carnet:
"+Carnet);
lblEtiquetaConOtra_2.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_2.setFont(fuente9b);
contentPane.add(lblEtiquetaConOtra_2);}
break;
}

/*JLabel lblEtiquetaConOtra_1 = new JLabel("Etiqueta con otra


fuente distinta");
lblEtiquetaConOtra_1.setBounds(56, 163, 350, 36);
lblEtiquetaConOtra_1.setFont(fuente1);
contentPane.add(lblEtiquetaConOtra_1);

JButton btnBotonConDistinta = new JButton("Boton con distinta


fuente");
btnBotonConDistinta.setBounds(56, 101, 218, 23);
btnBotonConDistinta.setFont(fuente1);
contentPane.add(btnBotonConDistinta);*/

}
}

También podría gustarte