-7

Thanks,I'm using WINDOWBUILDER (JBWILDER) First I create a folder called displayImage in my project called Magasin, I put all images I need in my application , then to load image I go to properties -> icon->absolute path in file system I browse I go to my project this is my project path("C:\Users\CLAUDE\workspace\Magasin\displayImage\load.jpg) automatically generate code look like this

JLabel lblNewLabel = new JLabel(""); 
lblNewLabel.setIcon(new ImageIcon("C:\Users\CLAUDE\workspace\Magasin\displayImage\load.jpg")); 
lblNewLabel.setBorder(new BevelBorder(BevelBorder.LOWERED)); 
lblNewLabel.setBounds(48, 11, 305, 153); panel.add(lblNewLabel);
EdChum
  • 376,765
  • 198
  • 813
  • 562
fofo
  • 1
  • 4

1 Answers1

1

By the time of deployment, those resources will likely become an . That being the case, the resource must be accessed by URL instead of File. See the info page for the tag, for a way to form an URL.

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 1) For better help sooner, post an [SSCCE](http://sscce.org/). 2) Please add an upper case letter at the start of sentences. Also use a capital for the word I, and abbreviations and acronyms like JEE or WAR. This makes it easier for people to understand and help. 3) 'can anyone help me?' is usually too vague a question to actually encourage people to help. OTOH 'How to load images in an installed application?' is more clear & specific. – Andrew Thompson Jul 09 '13 at 10:39