Slick2D Icon problem

Hey guys, I am working on a project for school using Slick2D, and I’m trying to change the icon of the program but no matter what size Icon I try to use none of them work, it just displays the default image for a program.

Here’s what I’m trying to change the icon to:

Here’s what it’s displaying:

My code:

	public Main(String name) throws SlickException {
		super(name);
		app = new AppGameContainer(this);
		app.setIcon(texturePath + "icon.png");
		app.setTargetFrameRate(75);
		app.setDisplayMode(600, 700, false);
		app.setForceExit(true);
		app.setShowFPS(false);
		app.setAlwaysRender(true);
		app.start();
	}

I have tried this with x16, x32, x64, x128 images and none of them have worked :confused:

I know its reading the right image, because if the path is incorrect it throws an error and closes the application.

Thanks!

Should it not be a icon.ico? Just an educated guess, never used slick 2d before.

I’ve seen videos of people using .png files for the icon, I tried the .ico too let me try it again

Yeah using .ico isnt’ working either.

Changing the file extension won’t do anything, the file still contains the same data. (However it might break poorly done decoders)

I’m not sure what’s wrong, but you might try passing several images of the different sizes in at once with setIcons(): http://slick.ninjacave.com/javadoc/org/newdawn/slick/AppGameContainer.html#setIcons(java.lang.String[])

changed code:

app.setIcons(new String[]{texturePath + "icon.png", texturePath + "icon16.png", texturePath + "icon64.png", texturePath + "icon128.png"});

still not working

The guy in this video does the same exact thing and it works perfectly fine:

Ah I figured it out! When I saved my PNG in Paint.net I had to make sure it saved as a 32-bit image instead of using Paint.net’s auto-detect.