Advertisement
jdalbey

ImageIO read from file example

Jun 4th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. BufferedImage img = null;
  2. try
  3. {
  4. img = ImageIO.read(new File("src/yahtzeeframework/resources/bonus_star.png"));
  5. } catch (IOException ex)
  6. {
  7. ex.printStackTrace();
  8. }
  9. lblBonus.setIcon(new javax.swing.ImageIcon(img));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement