Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "java.net.URL.toExternalForm()" because "location" is null.
The error is from this line of code:
home.addItem(new ModelItem(ID++, "Original Nuggets Meal", "", 90, "KFC", new ImageIcon(getClass().getResource("icon/img2.png"))));
i use the correct folder as it is in a package in the same source of the file. please help!