• 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

Icons not visible in applet

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear friends,

I have a created a JTree where every node has an icon. One class is that extends JPanel is being used for the tree, and everything works fine and the icons show correctly. However, when I create an instance of that class and add it to my Applet(which contains several other components), the icons are not visible.

Anyone has any idea why?

Any suggestions will be appreciated.

Regards,

Dani
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> ... Applet... the icons are not visible.

google

getCodeBase()
 
dani abdallah
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Dunn wrote:> ... Applet... the icons are not visible.

google

getCodeBase()



Thank you for your assistant. However I am still confused on how to use this. Are you assuming I need a reference to the icon so that I can use it directly in the applet?

If so, that is not the case(sorry i didn't explain everything so clearly at first) I am creating an instance of the JTreeComponent class that extends JPanel in MAIN class that also extends JPanel and that includes instances of all the other components I have created. This mainGUI is presented in an applet. When I run the JTreeComponent class separately I see the JTree with icons etc as i should, however when I run my applet (which creates a mainGUI instance) I cannot see the icon.

Apologies for the confusion, or maybe I am still missing something?

Regards,

Dani
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for an applet the icons need to be read via a URL

find some applet sample code that uses getCodeBase() to understand
 
dani abdallah
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Dunn wrote:for an applet the icons need to be read via a URL

find some applet sample code that uses getCodeBase() to understand



Thanks, I see the problem, appreciate your assistance.

Regards,

Dani
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic