Manage my Java images

I am creating a Java Swing gui, and I am wondering what would be the best way to manage all my images. So far, I just created images from different classes whenever I needed them, indicating the path of each of them, for example:

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

There are 2 things that I don't like. First of all, all these ways. Secondly, I would prefer a more similar "central repository" approach. Does anyone have a best practice to offer, I thought maybe something like ImageManager, which loads all the images at the very beginning of the program. Can property files in some way (never use them) with all of these paths?

thank

+5
source share
1 answer

key =, , - . , , ImageManager, , , ImageIcon .

+5

All Articles