Advertisement
Guest User

Untitled

a guest
Jan 30th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public BufferedImage getImage(Type type) {
  2. BufferedImage currentImage = null;
  3.  
  4. if (type == Type.CAR) {
  5. try {
  6. currentImage = ImageIO.read(getClass().getClassLoader().getResourceAsStream("cars/red.png"));
  7. } catch(Exception e) { System.err.println("Can't load image."); System.exit(0);}
  8. }
  9.  
  10. return currentImage;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement