• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's the most elegant approach when using icons ?

 
Edisandro Bessa
Ranch Hand
Posts: 584
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I would like to hear your opinions concerning the most elegant approach when using icons and other image types in my swing app.

For instance, I would like to change the system icon of my form, so I have to store such icon somewhere in my diretory structure.

I also have a JTree which according to the node type I also have to change the default folder icon shown by the API.

So I also have to have such icons stored somewhere.

What would be the best approach in these cases ?

Do you think I would simply store then in some directory and then hard code the relative directory when creating the ImageIcon object ?

Or do you think I should store them in a separate .jar file (possibly named as images.jar) and then use the getResource method
to load them ?

Or there's still another better approach I can't wonder.

I'm really interested about your opinions and would really appreciate if you could post some links to quick guides tutorials about
that.

TIA,
Edisandro Bessa.
[ September 18, 2006: Message edited by: Edisandro Bessa ]
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the section Loading Images Using getResource on the page How to Use Icons in the Swing Tutorial. Especially the last paragraph.
Everyone seems to have their own idea of what makes sense in design. I would say to put things together in any way that makes sense to you and is easy to use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic