Here is the error I'm getting
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: input == null!
And here is the code
try
{
//myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg"));
myPicture = ImageIO.read(getClass().getResource("/resources/Companylogo_FINAL.jpg"));
ImageIcon img = new ImageIcon(myPicture);
frame.setIconImage(img.getImage());
}
catch (IOException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
JLabel lbl = new JLabel(new ImageIcon(myPicture));
As you can see I have changed this line
myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg"));
To this
myPicture = ImageIO.read(getClass().getResource("/resources/Companylogo_FINAL.jpg"));
As by earlier code I was getting error "cannot read file"