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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:39:43+00:00 2026-06-13T23:39:43+00:00

Alright, so this is probably a really beginner problem here, but I’ve never actually

  • 0

Alright, so this is probably a really beginner problem here, but I’ve never actually used pictures inside my src folder. I always have linked my pictures to some folder like C:\\Resource\\Logo.png. I took a screenshot of how I’ve worked my directories. Basically I’m trying to get from net.mousemaze.Textures.java to Resource.Font\FontA.png.

Location of font image

Also, it may be worth noting that I am currently running on fedora 17.

the class that gets the images is pasted at
http://pastebin.com/KMVac7mg

also, the directories have been rearranged (screenshot updated) so i dont have to deal with going back a directory. Even so, it is not working.

  • 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-13T23:39:44+00:00Added an answer on June 13, 2026 at 11:39 pm

    If you look at the docs, there is a method called “createImageIcon” which works within jar files:

    /** Returns an ImageIcon, or null if the path was invalid. */
    protected ImageIcon createImageIcon(String path,
                                               String description) {
        java.net.URL imgURL = getClass().getResource(path);
        if (imgURL != null) {
            return new ImageIcon(imgURL, description);
        } else {
            System.err.println("Couldn't find file: " + path);
            return null;
        }
    }
    

    See if you can edit that code to fit your purpose.

    Edit: Link: http://docs.oracle.com/javase/tutorial/uiswing/components/icon.html

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

Sidebar

Related Questions

Alright, admittedly there are a lot of words here, but this is a problem
Alright, Im going about this, with what is probably a really complicated solution, but
Alright, this is probably a really silly question but I am new to Python/Django
Alright, I know questions like this have probably been asked dozens of times, but
Alright, probably not the best title, but meh. I have the following code inside
Alright, so this is probably a pretty easy question to answer, but I'm struggling
Alright so this problem has been breaking my brain all day today. The Problem:
Alright I know this is more than likely a amateur question but I have
Alright I don't see why this isnt working. It seems pretty simple. Here is
Alright, this is driving me nuts because my regex is working on Rubular, but

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.