wood burning stoves 2.0*
The moose likes Java in General and the fly likes getClass().getResource() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "getClass().getResource()" Watch "getClass().getResource()" New topic


Dhana Muthu

Joined: Nov 15, 2003
Posts: 2
I would like to use the getClass().getResource() inside a static method, which is basically a utility method.. But i'm getting non-static referece compilation error..
Any fixes ??
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi Dhana
Try this,

Dhana Muthu

Joined: Nov 15, 2003
Posts: 2
Yeah... i tried same kind of code and it worked...
Thanks .....
Don't get me started about those stupid light bulbs.
subject: getClass().getResource()
Similar Threads
My app uses a .txt file to retreive a list of usernames and passwords, can I jar it?
KeyEvent Problem
problem loading images
how to load a png-file?
getResource() from a static context