Java applet program that displays a simple message

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.awt.*;
import java.applet.*;
/*
 <applet code="sim" width=300 height=300>
 </applet>
 */
 public class sim extends Applet
 {
 		String msg=" ";
 		public void init()
 		{
 				msg+="init()--->";
 				setBackground(Color.orange);
 		}
 		public void start()
 		{
 			msg+="start()--->";
 			setForeground(Color.blue);
 
 		}
 		 public void paint(Graphics g)
 		{
 			msg+="paint()--->";
 			g.drawString(msg,200,50);
 		}
 }

Output:

Java Applet program output
Java Applet program output

11 Responses to “Java applet program that displays a simple message”

  1. Very Good and Useful Programs Written by You …..
    Thanks a lot For these type of Programs…

    Suresh

    Reply
  2. Naveen

    Can anyone tell me why almost every browser doesn’t support the applet code.
    I tried enabling PPAPI and NPAPI in chrome and tested it on almost all browsers that I could find.
    Thank you for this simple, yet effective tutorial…

    Reply
  3. Solanki bharat kumar

    Me java me application baya he
    mobile.8347081235

    Reply

Leave a Reply