Não está aparecendo a imagen no panel2 q eu add o JDesktopPanel pq ?
antes que perguntem a imagem está no diretrio da class!!!
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class desk extends JFrame {
public desk(){
super("Problemas com JDesktopPane");
this.setBounds(200,200,500,400);
this.setLayout(null);
JPanel panel1 = new JPanel();
panel1.setBackground(Color.BLACK);
panel1.setBounds(0,0,500,100);
this.add(panel1);
JPanel panel2 = new JPanel();
panel2.setBounds(0,100,500,300);
JLabel img = new JLabel(new ImageIcon("src/naveRyouta3.jpg"));
img.setBounds(0,100,500,300);
img.setVisible(true);
JDesktopPane desk = new JDesktopPane();
desk.add(img);
panel2.add(desk);
this.add(panel2);
this.setVisible(true);
}
public static void main (String[]a){
new desk();
}
}