//Clase panel
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 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 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