hi i try to write a derived class of game.Layer , just like Sprite or tiledLayer, so , i implement a paint() method.but some problem appear: code : class testlayer extends Layer{ public paint(Graphics g){} }

Sadly, there is no way to write a derived class from Layer, which i have tried before.

I have downloaded the source file of MIDP from Sun, to see how to write the constructor of Sprite. From the constructor of Sprite, I found the constructor for Layer, which takes two parameters (int width, int height).

Then, i switched to the source code of Layer to see the details, the constructor there is declared as default, and there is a comment that declaring as default is to prevent developers from subclassing this class - Layer.

Since there is no way for me to declare my class to be in the same package as Layer, there is no way to sub-class Layer.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org