double-buffer from different class?
<p>This in my class that is added to my JFrame. can anyone help me with how I can draw graphics from anouther class using this classes offScreen? for example have a Player class (Player.java) and draw an image and other things from that class but still buffer the image without making new double buffering methods in each class im drawing from? </p>

<pre><code>package Display;

import Graphics.Player1;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
      import javax.swing.JPanel;



      public class DrawArea extends JPanel implements Runnable{      
    Thread drawLoop = new Thread(this);
    BufferedImage image = new BufferedImage(1000, 700, BufferedImage.TYPE_INT_RGB);
   public Graphics offScreen = image.getGraphics();

    public DrawArea() {
        setSize(1000, 700);
        drawLoop.start();

    }

    public void update(Graphics g) {
        paint(g);
    }

    public void paint(Graphics g) {
        offScreen.setColor(Color.yellow);
        offScreen.fillRect(0, 0, 1000, 700);

        g.drawImage(image, 0, 0, null);
    }

    public void run() {
        while(true) {
            repaint();
            try {
                drawLoop.sleep(90);
            } catch (InterruptedException ex) {
                Logger.getLogger(DrawArea.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

}
</code></pre>
