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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:25:38+00:00 2026-06-10T07:25:38+00:00

I am building a Java Swing gui and I am wondering what the best

  • 0

I am building a Java Swing gui and I am wondering what the best way of managing all my images would be. So far I have just been creating images from different classes whenever they are needed, by pointing out the path of each one, for example:

ImageIcon temp= new ImageIcon("resources/pictures/temp.png");

There are 2 things I don’t like. First thing would be having all those paths. Second would be that I would prefer a more like “central repository” approach. Does anyone have a better practice to suggest, I was thinking maybe something like an ImageManager that loads all the images at the very start of a program. Can property files help somehow (never used them) with all those paths?

Thanks

  • 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-10T07:25:39+00:00Added an answer on June 10, 2026 at 7:25 am

    Properties can be used for defining some key=value where key would be a unique key and value would be a path to the image. Then, as you suggested, you could use an ImageManager that could define methods that would get a key as a parameter and would return a reference to an ImageIcon or whatever the image type must be.

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

Sidebar

Related Questions

I'm currently building a Java Swing GUI and I was wondering how user (mouse,
I'm building a Java application with a Swing GUI and a task that takes
I'm building a Tic Tac Toe game in Java with a Swing GUI, and
I have been building a Java version of Monopoly in my spare time and
I am looking for a Java GUI building tool that generates the Java Swing
The naive way of writing building a menu in a Java Swing app is
Building a lottery scratch-card app in Java. Have allot of it done, just need
I am building a Text Editor in Java(Swing) having an EditorPane to type the
I'm currently working on building a java web app. I've been looking to use
I am building an application in java swing and I am using the following

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.