方法 getDrawGraphics() 未定义字符串类型,方法 show(int[]) 未定义字符串类型

The Method getDrawGraphics() is undefined for type string and The Method show(int[]) is undefined for type string

我正在学习 TheChernoProjects 教程并且正在尝试绘制像素 到屏幕。 . .这是我的代码:

    private void Render() {

    BufferStrategy BufferSrat = this.getBufferStrategy();

    if (BufferStrat == null) {

        createBufferStrategy(3);
        return;

    }

    Screen.Render();

    for (int i = 0; i < (WindowWidth * WindowHeight); i++) {

        Pixels[i] = Screen.Pixels[i];

    }

    Graphics GG = BufferStrat.getDrawGraphics();
    GG.drawImage(Image, 0, 0, WindowWidth, WindowHeight, null);
    GG.dispose();
    BufferStrat.show(Pixels);

}

错误是:'The Method getDrawGraphics() is undefined for type string' 和 'The Method show(int[]) is undefined for type string' 我正在使用 eclipse luna 和 Java SE 1.7

请帮忙,谢谢!

你在你的行中打错了BufferStrategy BufferSrat = this.getBufferStrategy();

应该是BufferStrategy BufferStrat = this.getBufferStrategy();