Re: Giving an application a window icon in a sensible way
Twisted wrote:
* Worry about end-users' inevitably encountering said problem and
having no clue anyway how to find the file and put it where it needs to
be or otherwise fix whatever went wrong -- likely, their recourse will
have to be to reinstall the app. Yuck! I'll be looking an awful lot
like Microsoft then -- my stuff stops working and has to be reinstalled
and such!
This tends to be a non-issue. It's just as likely to be missing a
..class file from a jar than to be missing a .jpg file. I don't see why
you make the distinction, there is truely nothing special about a
..class file as far as files are concerned. And frankly, I think the
error message "Couldn't find icon file 'c:/program
files/myapp/resources/myapp.jpg'" is a lot nicer error message that
"NoClassDefFoundException: net.twisted.IconClass."
As far as I know, the class loaders uses getResource internally to get
the .class file.
Also notice, you have now spent more energy defending your approach
than you would have taken to learn the new approach. What could it hurt
you to experiment with getResources for half an hour, and see for
yourself that it is or isn't what you need?
getResources DOES NOT require you have a jar file, but it DOES ALLOW
you to have a jar file, or a file somewhere else.
Well, I hope I never have to work on the same codebase as you. Its
never fun to work with a stubborn programmer who doesn't have enough
experience to back up their claims. You're expierence is "I found it
on google, so it must be right." Our experience is "We've used this
approach many times, and it works very well."
Enjoy the monster you are creating, and when you find you need to
rewrite it because its become impossible to maintain, consider using
getResources instead.