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 8895941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:54:52+00:00 2026-06-14T23:54:52+00:00

I made an application in which I had some images to be loaded for

  • 0

I made an application in which I had some images to be loaded for icons. The program runs fine with every thing working and images loading as expected , when I was loading the images using

imageOpen = Toolkit.getDefaultToolkit().getImage("Images\\open.png");

But when I exporter it as jar the Images didn’t show up
Then after looking here and there I tried some things but in both cases the URL is returning null

URL u = this.getClass().getResource("Images\\open.png");
imageOpen = Toolkit.getDefaultToolkit().createImage(u);

Another case

ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
URL resource = classLoader.getResource("Images\\open.png");
imageOpen = Toolkit.getDefaultToolkit().createImage(resource);

Can any one tell me why am I getting null , I even tried “\Images\open.png” ,”/Images/open.png” and “.\Images\open.png” for the path
I am using eclipse and the images are stored in the parent directory in a folder named Images and the source files are in src>master

  • 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-14T23:54:53+00:00Added an answer on June 14, 2026 at 11:54 pm

    I was able to achieve the solution to my problem with the help of a making resource bundle for the jar and taking the path from that file

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

Sidebar

Related Questions

I've made a chat application for a website. Everything is working fine, however, I
I am currently working on a .Net application which makes HTTP requests to some
I have made an application, which keeps getting updated frequently. So every time a
I have made an application which uses latest ios facebook sdk to connect. I
I made an android application which connects to a local web service on my
I have made a sample application which constructs a filter graph to capture audio
I've made a console application which inserts data into a MySql backend, and reads
I've been given a Flex application which made use of a RESTFUL service. I've
I'm in the process of creating a C# application which will monitor changes made
Visual Studio 2010 Express, Windows Forms. Have made myself my first little application which

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.