how to add two image to two different jframes
hi guys,
i have been trying to add images to jpanel but one image is shadowing the other.they are not placing at different places in a jframe.
this i have tried.....
public Frame() {
setSize(800,800);
jPanel1=new javax.swing.JPanel();
jPanel2=new javax.swing.JPanel();
jPanel1.setBackground(Color.RED);
jPanel2.setBackground(Color.CYAN);
ImageIcon icon1 = new ImageIcon("C:/Documents and Settings/Desktop/WeSellMoreTicketsBannerAd.jpg");
ImageIcon icon2= new ImageIcon("C:/Documents and Settings/Desktop/redcowel2.jpg");
JLabel label1 = new JLabel();
JLabel label2= new JLabel();
label1.setIcon(icon1);
jPanel1.add(label1,BorderLayout.PAGE_START);
label2.setIcon(icon2);
jPanel2.add(label2,BorderLayout.PAGE_END);
this.getContentPane().add(jPanel1);
setVisible(true);
this.getContentPane().add(jPanel2);
setVisible(true);
}
i am really confused with this code please if anyone can help.