lunes, 19 de marzo de 2012

Parte 4: Simulando Maquina de Recargas del Mexibus

//Clase Procesando

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Procesando extends JFrame{
int costo=15;
Hilo1 h1=new Hilo1();
JLabel lblTexto=new JLabel("OPERACION EXITOSA");
JLabel lblTexto2=new JLabel("Tu saldo actual es: $");
JLabel lblTexto3=new JLabel();

public Procesando(String lblpes){
Panel p=new Panel();
setTitle("Procesando");
setSize(800,650);

lblTexto3.setText(lblpes);
p.setLayout(null);

lblTexto.setFont(new Font("Arial", Font.BOLD,30));
p.add(lblTexto);
lblTexto.setBounds(250,200,400,100);

lblTexto2.setFont(new Font("Arial", Font.BOLD,30));
p.add(lblTexto2);
lblTexto2.setBounds(250,260,400,100);

lblTexto3.setFont(new Font("Arial", Font.BOLD,30));
p.add(lblTexto3);
lblTexto3.setBounds(550,260,400,100);

Container c=getContentPane();
c.add(p);

h1.start();

}
class Hilo1 extends Thread{
public void run(){
try{
Thread.sleep(7000);
dispose();
new Sistema().setVisible(true);
}catch(Exception er){
System.out.println("Error" + er);
}
}
}


}



//Clase ProcesandoRec

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ProcesandoRec extends JFrame{
int costo=15;
Hilo1 h1=new Hilo1();
JLabel lblTexto=new JLabel("OPERACION EXITOSA");
JLabel lblTexto2=new JLabel("Tu saldo actual es: $");
JLabel lblTexto3=new JLabel();

public ProcesandoRec(String lblTotal){
Panel p=new Panel();
setTitle("Procesando");
setSize(800,650);

lblTexto3.setText(lblTotal);
p.setLayout(null);

lblTexto.setFont(new Font("Arial", Font.BOLD,30));
p.add(lblTexto);
lblTexto.setBounds(250,200,400,100);

lblTexto2.setFont(new Font("Arial", Font.BOLD,30));
p.add(lblTexto2);
lblTexto2.setBounds(250,260,400,100);

lblTexto3.setFont(new Font("Arial", Font.BOLD,30));
p.add(lblTexto3);
lblTexto3.setBounds(550,260,400,100);

Container c=getContentPane();
c.add(p);

h1.start();

}
class Hilo1 extends Thread{
public void run(){
try{
Thread.sleep(7000);
dispose();
new Sistema().setVisible(true);
}catch(Exception er){
System.out.println("Error" + er);
}
}
}


}

No hay comentarios:

Publicar un comentario