import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;

import javax.swing.*;

@SuppressWarnings("serial")
public class Applet2015b extends JApplet implements ActionListener {
	int fps = 75;
	Timer timer = new Timer(1000 / fps, this);
	
	{
		timer.start();
	}
	
	int x = 0;
	
	@Override
	public void paint(Graphics g) {
		BufferedImage bufferedImage = new BufferedImage(this.getWidth(),
				this.getHeight(), BufferedImage.TYPE_INT_RGB);
		Graphics g2 = bufferedImage.getGraphics();
		g2.setColor(Color.PINK);
		g2.fillRect(0, 0, this.getWidth(), this.getHeight());
		g2.setColor(Color.BLACK);
		g2.drawLine(x, 0, x + 100, 100);
		g2.fillOval(x, x, 40, 40);
		g.drawImage(bufferedImage, 0, 0, Color.CYAN, null);
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == timer) {
			x += 1;
			repaint();
		}
	}
}
