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

Editorial Team
Editorial Team

We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.

8 thoughts on “Java applet program that displays a simple message

  1. 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…

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in