Code:
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class Back extends Applet
{
public void init()
{
setBackground(Color.red);
setForeground(Color.blue);
}
public void paint( Graphics g )
{
g.drawString(" Welcome to Coding Atharva ",10,100);
}
}
/*
<applet code="Back" height=200 ; width = 200 >
</applet>
*/
Ouput:
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class Back extends Applet
{
public void init()
{
setBackground(Color.red);
setForeground(Color.blue);
}
public void paint( Graphics g )
{
g.drawString(" Welcome to Coding Atharva ",10,100);
}
}
/*
<applet code="Back" height=200 ; width = 200 >
</applet>
*/