Undefined Method?

If this class is a subclass of my main class, it works. If I move it to its own class and add all the imports that Eclipse wants, I get an error.

import java.awt.Image;
import java.awt.Image.*;
import java.awt.image.CropImageFilter;
import java.awt.image.FilteredImageSource;
import java.util.HashMap;
import java.util.Map;



public class Chara {

	//Create a list for the Sprite images
	//ArrayList<Sprite> sprite = new ArrayList();
	Map<String, Sprite> sprite = new HashMap<String, Sprite>();
	int angle;
	int lastAngle;
	int x;
	int y;
	float gx;
	float gy;
	
	public Chara(Image SpriteSheet)
	{
		
		sprite.put("fl", new Sprite());
		sprite.get("fl").img = createImage(new FilteredImageSource(SpriteSheet.getSource(), 
				new CropImageFilter(0, 0, 32, 32)));
	}
}

The error is: The method createImage(FilteredImageSource) is undefined for the type Chara
I don’t know how to fix it.

Ok, so I solved it. Chara() needs to extend Component. I figured that out after looking at the definition of createImage when Chara() was a subclass. I don’t know why, my main class only extends Applet… What ever I guess, Onward.

Correct me if i am wrong but applet is sub class of component and inherits all components fields/methods.
By the way do yoy initalize your class (new) before calling its metods ?

Toolkit.getDefaultToolkit().createImage(…);

?

@Fokusas, You’re probably right. And yes, I do initialize multiple copies of my class Players 1 - 8.