Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9002471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:34:31+00:00 2026-06-16T00:34:31+00:00

This is probably just the IDE specifics. But with Eclipse, I’m interested in organizing

  • 0

This is probably just the IDE specifics. But with Eclipse, I’m interested in organizing my classes and resources a little more-so.

As I understand it, the defaulted “src” directory is the place to throw all my resources.
And if my resources reside in there I can reference them like this:

ImageIcon icon = new ImageIcon("src/icon-16x16.png");

If I create a directory just for icons (inside the src/ directory), then I simply change the path as such:

ImageIcon icon = new ImageIcon("src/icons/icon-16x16.png");

So, now I want to do a separate directory for my resources outside the src/ directory.

Here’s my old structure:

prj.HelloWorld  (project)
-> src/ .........
-> src/images/ ........
-> src/ (default package) ......classes.java

Here’s what I’ve cleaned up:

prj.HelloWorld  (project)
-> classes/ .........
-> images/ ........
-> media / ........

Now, I’m interested in using a dedicated Project (prj.Resources), just for my common resources I can share in all projects.

prj.Resources  (project)
-> global_classes/ .........
-> global_images/ ........
-> global_media / ........

prj.HelloWorld  (project)
-> classes/ .........
-> images/ ........
-> media / ........

And then modify prj.HelloWorld by adding prj.Resources to the Projects Tab inside the Java Build Path.

(prj.HelloWorld > Properties > Java Build Path > Projects Tab > Add…)

I’ve done that so far, and any classes inside the prj.Resources/global_classes/ are successfully being detected.

But images inside global_images are not.

ImageIcon icon0 = new ImageIcon("global_images/icon.png");

I know we can use resources located in different projects, but I’m missing something obvious here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:34:32+00:00Added an answer on June 16, 2026 at 12:34 am

    YOu can not access global_images folder as its not in its root folder for HelloWorld Project.

    But you can give relative path as showing that project resource folder.

          ImageIcon icon0 = new ImageIcon("../Resources/global_images/icon.png");
    

    Path Information

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably just something I don't understand about c++, but why does this
This is probably just me being stupid somehow or the other, but I am
This will probably be just another unsolved thread but i'll fill in some info
This is probably more a design or style question: I have just been considering
This is probably something really simple but for some reason I just can't seem
This is probably a pretty basic question, but just something that I wanted to
This is probably quite simple, but I just don't know how to do this...
This is probably just a crazy pipe dream but I thought I would ask
This is probably me just remembering things completely backwards, but I'd like to know
This is probably just my own ignorance of how events work, but can someone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.