Gostaria que o codigo abaixo produzisse o mesmo efeito da imagem!
O que ta errado?
O que falta?
Obrigado!
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Exe08 extends JFrame{
public Exe08(){
Exe04 f1 = new Exe04();
Exe05 f2 = new Exe05();
Exe06 f3 = new Exe06();
ImageIcon imagem = new ImageIcon(new ImageIcon("src/background.jpg").getImage());
JLabel label = new JLabel();
JDesktopPane dp1 = new JDesktopPane();
this.setSize(640,480);
this.setVisible(true);
this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
this.add(dp1);
label.setIcon(imagem);
label.setSize(640,480);
dp1.add(label);
f1.setSize(250, 250);
f1.setVisible(true);
f1.setTitle("Janela Interna 1 ");
f2.setSize(250,250);
f2.setVisible(true);
f2.setTitle("Janela Interna 2 ");
f3.setSize(250,250);
f3.setVisible(true);
f3.setTitle("Janela Interna 3 ");
dp1.add(f1);
dp1.add(f2);
dp1.add(f3);
dp1.setVisible(true);
}
public static void main(String[] args) {
Exe08 ex8 = new Exe08();
}
}
