please don't mark this as a double, because I have searched stackoverflow already, and all the questions I can find are talking about JApplets or JFrames.
I am very new to programming, I learnt some basics off Youtube. Unfortunately, the video tutorial I watched on how to make a simple applet told me to use Applet rather than JApplet. I don't know why.
Anyway, my Applet is finished now, and all I need to do is add an icon to replace the coffee cup in Explorer/Finder.
I have the image I want set up in a "Resources" class.
public class Resources {
static Image iconimage;
URL url;
static StartingPoint sp; //StartingPoint is my main class
public Resources(StartingPoint sp) {
try{
url = sp.getDocumentBase();
}catch (Exception e){
}
iconimage = sp.getImage(url, "Images/iconimage.png");
this.sp = sp;
}
}
Now in my main class I have:
public class StartingPoint extends Applet{
Image icon = Resources.iconimage;
URL url;
public void init() {
setIconImage(icon);
}
}
However I get the error: "The method setIconImage(Image) is undefined for the type StartingPoint"
Could someone please explain a fix/different method of setting the icon? Thanks a lot! I really appreciate all the help this community has been giving me.