Welcome to you all
I have a slight problem with adding pictures ta JFrame , I'm trying to add a picture to a JLable. It works fine in the simulater, when I'm using Swing Packet in Eclipcs program. However, when I try to run the program, the image disappear completely?!!
see the pic here : http://im33.gulfup.com/yf7PH.jpg
Here is part of my code :
JLabel Pic1 = new JLabel("");
Pic1.setIcon(new ImageIcon("C:\\Users\\Al- Yamani\\Downloads\\DSC_0243.bmp"));
Pic1.setHorizontalAlignment(SwingConstants.CENTER);
Pic1.setBounds(290, 11, 75, 42);
contentPane.add(Pic1);
I do not know what is the problem?!
Also, when I try to add an icon on the title bar, it did not show as well!
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\user\\Pictures\\gifts-icon.png"));
^^ Both codes are in my constracter body: public JFrameName(){.....}