I just found out that even with the API Javadocs leading you to believe it is possible to subclass layer by saying “Layer subclasses must implement a paint(Graphics) method so that they can be rendered”, the class cannot be subclassed by MIDP 2 developers.
The constructor of class Layer has default visibility, meaning that only classes within the same package can see the constructor.
I really believe it’s a bug. I see no reason for it to be this way. If they wanted the developers not to be able to extend Layer functionality, they would also make Sprite and TiledLayer final classes. As of today, the only way to extend a Layer is by subclassing one of those, wich is very ackward if what you intend is to create a diferent kind of a layer.
What are your soughts about that? I have found nothing on Sun about it.