私は今、JApplet を書いています。super.paint() を呼び出すたびに、アプレットがちらつきます。ダブル バッファリング (画像に描画してからその画像をレンダリングする) を使用していますが、super.paint() が画面などをクリアして、ダブル バッファを無効にしていると思います。
paintComponents() を使用することになっていることはわかっていますが、何らかの理由で、「currentScreen.Draw(g)」を呼び出すと、画面の描画が表示されません。
誰でもこれで私を助けることができますか?
public void paint(Graphics g)
{
super.paint(g);//Remove this and it works, but the JApplet background color will be gone, and everything will be white.
currentScreen.Draw(g);
}
画面描画方法
public void Draw(Graphics g)
{
if(buffer != null)
g.drawImage(buffer, 150, 0, null);
//g.drawString(drawstring, x, y);
}