Okay, so I\'ve been trying to load a BufferedImage using this code:
URL url = this.getClass().getResource(\"test.png\"); BufferedImage img = (BufferedImage)
BufferedImage img = null; try { img = ImageIO.read(new File("D:\\work\\files\\logo.jpg")); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
Use ImageIO.read() instead:
BufferedImage img = ImageIO.read(url);