Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Igor Cher
committed
Aug 26, 2013
1 parent
706d7fb
commit c283f2f
Showing
6 changed files
with
157 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package hrider.ui; | ||
|
||
import javax.swing.*; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class Images { | ||
|
||
private static Map<String, ImageIcon> images; | ||
|
||
private Images() { | ||
} | ||
|
||
static { | ||
images = new HashMap<String, ImageIcon>(); | ||
} | ||
|
||
public static ImageIcon get(String name) { | ||
if (images.containsKey(name)) { | ||
return images.get(name); | ||
} | ||
|
||
ImageIcon icon = new ImageIcon(Thread.currentThread().getContextClassLoader().getResource(String.format("images/%s.png", name))); | ||
images.put(name, icon); | ||
|
||
return icon; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.