
-----------------------------------
smaxd
Fri Mar 02, 2012 7:07 pm

Applet Repaint Issues
-----------------------------------
When I translate this shape the graphics object doesn't clear the last frame of said shape.
Im trying to make that one shape move, not a line. Im not sure on how to stop this bug from happening,
any help would be greatly appreciated.
[code]import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;

import javax.swing.JApplet;


public class Test extends JApplet {
	private Rectangle shape = new Rectangle(20,20,20,20);
	private Graphics g2;
	/**
	 * Create the applet.
	 */
	public Test() {
		Move ti = new Move();
		ti.start();
	}
	
	public void paint(Graphics g){
		Graphics2D g2 = (Graphics2D) g;
		g2.fill(shape);
	}
	
	private class Move extends Thread{
		
		public void run(){
			try{
				for(int x=  0; x