import java.awt.*;
class MyFrame extends Frame {
	int xy[]= {120,0}, ci=0, mi=0, turn=0;
	Font fb = new Font("TimesRoman", Font.BOLD, 36);
	String m[]={"Easy", "Portable", "Secure", "Java"};
	Color c[]={Color.red, Color.yellow, Color.green, Color.blue};

	public void paint(Graphics g) {
		g.setFont( fb );
		g.setColor( c[mi] );
		g.drawString(m[mi],xy[0],xy[1]);
		if ( (xy[turn]+=3) < 200) return;
		mi=++mi==m.length?mi=0:mi;
		xy[turn]=(turn+1)*60;
		xy[turn=1-turn]=0;
	}
	static public void main(String s[]) throws Exception {
		MyFrame mf = new MyFrame();
		for (int i=0; i<4;i++) 
			for (int j=0;j<200;j++) {
				mf.repaint();
				Thread.sleep(5);
		}
		System.exit(0);
	}
	MyFrame() {super("Java is easy"); setSize(200,200); show();}
}

