Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with jlabel to display image as background  RSS feed

 
Sudhir Pawar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
problem with jlabel not able to display image as background after making .jar file in eclipse IDE and run this file on another computer rather than my computer.
on my computer background image is appearing properly.
please help me to solve this problem.

This code is generated when iselect image icon for jlabel as background image
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the Swing tutorial on How to Use Icons for the proper way to read an image from a .jar file.

Also, don't use setBounds() on the label. Let the layout manager determine the location and the image will determine the size.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!