コード:
public class EmptyTile extends TileEntity{ //error on this brace
try{
defaultTexture=TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("stone.png")); //defaultTexture is created in the class that this class extends
}catch (IOException e) {
e.printStackTrace();
} //also an error on this brace
public EmptyTile(int x, int y, int height, int width, Texture texture) {
super(x, y, height, width, texture);
}
}
また、try/catch ステートメントを EmptyTile コンストラクターに移動しようとしましたが、スーパー コンストラクターが呼び出される前に既定のテクスチャを初期化する必要があり、これは明らかに許可されていません。
また、このクラスの親クラスで defaultTexture 変数を静的および通常の両方にしようとしました。