
Write an applet program for displaying 3 different sentences with 3 different colors

import java.applet.*;
import java.awt.*;
/*
<applet code= colr width=500 height=500>
</applet>
*/
public class colr extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.RED);
g.drawString("Hello ",0,10);
g.setColor(Color.BLUE);
g.drawString("I am Chirag Viradiya",20,20);
g.setColor(Color.ORANGE);
g.drawString("from Surat,Gujarat.",40,30);
g.setColor(Color.BLACK);
g.drawString("viradiyachirag@hotmail.com",60,40);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.