This java code is for simple applet.