write an applet that sets the background colour


Write an applet that sets the background colour to cyan and foreground colour to red and displays a message that illustrates the order in which various applet methods are called when an applet starts up. For example:

inside ini t ()...inside start( )...

import java.awt . *

import java.applet . * //import package

public class Method_order Extends Applet  //declaration of class

{

String msg;

/ /Sets the background and also foreground color.public void init( )

{

setBackground(Color .cyan);

setForeground(Color .red);

msg =" inside init 0- -";

}

/ / string is initialize to be displayed.

public void init( )

{

msg =" inside startO- - ";

}

lSets the background and foreground color.

public void paint (Graphics g)

{

msg =" inside paint () -";

g.drawst ring(msg, 10 , 30);

}

}

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: write an applet that sets the background colour
Reference No:- TGS0283168

Expected delivery within 24 Hours