Hey right now i'm simply writing a probram that will move crosshairs around the screen with green ships put on the screen and that's all it's supposed to be doing but it flickers and i'm using double buffering:
import static java.lang.System.*;
import java.io.*;
import java.util.*;
import java.text.*;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;

public class prob1 extends Applet implements MouseListener,MouseMotionListener,Runnable
{
int px=0,py=0,opx=0,opy=0,radi=10;
Image vMem;
Graphics s;
Thread pl;
ArrayList<Ship> ships = new ArrayList<Ship>();
public void init()
{
int aW=getWidth();
int aH=getHeight();
px=getWidth()/2;py=getHeight()/2;
opx=px;opy=py;
vMem=createImage(aW,aH);
s = vMem.getGraphics();
addMouseListener(this);
addMouseMotionListener(this);
createShips();

pl=new Thread();
}
public void run()
{
drawCrosshair();

}
public void createShips()
{
for(int x=0;x<5;x++)
ships.add(new Ship(x*30,30,10,s));
}
public void drawShips()
{
for(int x=0;x<ships.size();x++)
ships.get(x).drawShip();
}
public void paint(Graphics screen)
{
drawShips();
drawCrosshair();
screen.drawImage(vMem,0,0,this);
super.paint(screen);
}
public void drawCrosshair()
{
s.setColor(Color.white);
s.drawOval(opx,opy,1,1);
s.drawOval(opx-radi,opy-radi,radi*2,radi*2);
s.drawLine(opx,opy+radi+3,opx,opy-radi-3);
s.drawLine(opx-radi-3,opy,opx+radi+3,opy);
opx=px;opy=py;

s.setColor(Color.black);
s.drawOval(px,py,1,1);
s.drawOval(px-radi,py-radi,radi*2,radi*2);
s.drawLine(px,py+radi+3,px,py-radi-3);
s.drawLine(px-radi-3,py,px+radi+3,py);
}
public void mouseClicked(MouseEvent evt){}
public void mousePressed(MouseEvent evt){}
public void mouseMoved(MouseEvent evt)
{
px=evt.getX();
py=evt.getY();
drawCrosshair();
repaint();
}
public void mouseDragged(MouseEvent evt)
{
px=evt.getX();
py=evt.getY();repaint();
}
public void mouseReleased(MouseEvent evt){}
public void mouseExited(MouseEvent evt){}
public void mouseEntered(MouseEvent evt){}

}