• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying Images Using HTML

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically what I'm doing is that I want to show images in JLabels using HTML in the Text Property.

so the Text Property of JLabel1 reads: <HTML><img src=test.png>

but it doesn't seem to work, I've tried "./test.png" and "C:\.....\test.png" (absolute path) and so far everything's failed, it just shows up as a red "X".

I have noticed that it works with URLs, for example <HTML><img src=https://ssl.gstatic.com/sites/p/b46d27/system/app/images/logo/logo.gif>

displays just fine.

Does anyone know how to resolve this?

Sorry just before people go on telling me alternative solutions - I know there are image objects and other ways to squeeze an image into a Label, but this is specifically requested by my co-worker...since we're using this other Java module that will replace the text property later (we do not have access to other property members...and this module is developed by another team).



your suggestions are greatly appreciated!!!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic