Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By JosAH

Thread: Better way to load resources from resource-only package

  1. #1
    Stoyicker is offline Member
    Join Date
    Jan 2012
    Rep Power

    Question Better way to load resources from resource-only package


    I've got a package, res, which is said to contain all the resources of my application. To easily load them, I have a class inside that package, with only this code:

    Java Code:
    package res;
    public abstract class ResLoader {
    Then what I do to load resources from any other class is:

    Java Code:
    Am I wrong or there is a better way to do this?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power

    Default Re: Better way to load resources from resource-only package

    You can also specify the absolute path for your resources: /res/YourResource and use any Class object you want.

    kind regards,

    Stoyicker likes this.
    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. could not load load from location:/test_subreport.jasper
    By jadeite100 in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 03-27-2012, 12:43 PM
  2. Compiler runtime package load error
    By Dark-Redd in forum Advanced Java
    Replies: 17
    Last Post: 10-09-2011, 10:21 AM
  3. Resources load in Eclipse but not in standalone .jar
    By leonsbuddydave in forum New To Java
    Replies: 0
    Last Post: 01-14-2011, 06:07 AM
  4. Replies: 1
    Last Post: 12-21-2010, 02:42 AM
  5. Replies: 0
    Last Post: 03-22-2010, 03:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts