lunes, 19 de marzo de 2012

Parte 5: Simulando Maquina de Recargas del Mexibus

//Clase panel

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

public class Panel extends JPanel {
public void paintComponent(Graphics g){
Dimension tamano=getSize();
ImageIcon imagenFondo=new ImageIcon("Fondo.jpg");
g.drawImage(imagenFondo.getImage(),0,0,tamano.width,tamano.height,null);
setOpaque(false);
super.paintComponent(g);

}
}


//Clase Panel2

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

public class Panel2 extends JPanel {
public void paintComponent(Graphics g){
Dimension tamano=getSize();
ImageIcon imagenFondo=new ImageIcon("Inicio.jpg");
g.drawImage(imagenFondo.getImage(),0,0,tamano.width,tamano.height,null);
setOpaque(false);
super.paintComponent(g);

}
}

//Lo mas importante el metodo main
//Clase mainSistema

public class mainSistema {

public static void main(String[] args) {
Sistema sis=new Sistema();
sis.setLocation(100, 50);
sis.setVisible(true);
//new Sistema().show();


}

}

No hay comentarios:

Publicar un comentario