Ale46/groovejaar — Issue #2: Helper method to get images?
Author: hennr
Created: 2012-01-11 18:05:34+00:00
State: open

Hi, I wrote a small helper class with three simple methods which you can use to get an image.
You can just call getImg/getImgIcon/getLogo instead of:
foo.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().getImage(getClass().getResource("images/alldl.png"))));
which will be:
ImageLoader il = new ImageLoader();
foo.setIcon(il.getLogo());
or
foo.setIcon(il.getImgIcon("icon.png"));
afterwards.
The advantage is that you will only have one folder for all images instead of spreading them all over the source code.

I refactored the complete code, are you interested in a patch?