Normal
Jetzt bekomme ich beide Errors[code=Java] public static BufferedImage loadImg(String path){ img = null; try{//hier bekomme ich die IllegalArgumentException img = ImageIO.read(Menu.class.getResourceAsStream(path)); }catch(Exception e){ e.printStackTrace(); } return img; }[/code][code=Java]//Hier die NullpointerExceptionJLabel gifLabel = new JLabel(new ImageIcon(loadImg("src/Matrix_Anfang.gif")));[/code]
Jetzt bekomme ich beide Errors
[code=Java] public static BufferedImage loadImg(String path){
img = null;
try{
//hier bekomme ich die IllegalArgumentException
img = ImageIO.read(Menu.class.getResourceAsStream(path));
}catch(Exception e){
e.printStackTrace();
}
return img;
}[/code]
[code=Java]
//Hier die NullpointerException
JLabel gifLabel = new JLabel(new ImageIcon(loadImg("src/Matrix_Anfang.gif")));[/code]