public void dispose() { if (image != null) { image.dispose(); image = null; } if (animation != null) { animation.dispose(); animation = null; } }