Java Correct (Buffered)Image Loading


SUBMITTED BY: Guest

DATE: Dec. 6, 2013, 5:52 p.m.

FORMAT: Java

SIZE: 253 Bytes

HITS: 785

  1. //Tutorial how to correctly load an internal (inside the JAR) (buffered)image in Java:
  2. try{
  3. ImageName = IamgeIO.read(YourClassName.class.getResource("/package1/package2/filename.png"));
  4. }
  5. catch (IOException e){
  6. e.printStackTrace();
  7. }

comments powered by Disqus