• Post Reply Bookmark Topic Watch Topic
  • New Topic

set picture as background of JFRAME and JPanel

 
sandhiya sindhi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How Can I use Picture as Background of JFrame and JPanel
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you search this forum, you will find that this has been answered numerous times.
 
narayana murthy pedapudi
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
U can use the following code
JLabel weatherImgLab;
ImageIcon weatherImage;
weatherImage= new ImageIcon("xxx.gif");
weatherImgLab= new JLabel();

weatherImgLab.setBounds(0,2,weatherImage.getIconWidth(),weatherImage.getIconHeight());
weatherImgLab.setIcon(weatherImage);
add that JLabel to the required panel or container...then on that panel u can also add what ever u want ....then that jlabel will look as background
all the best...
if u still have doubt.......
mail me
p_narayanamurthy@yahoo.com
bye
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A more module approach would be to do it this way
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!