How to print color text in java applet?

Hello Friends, 


Today I will explain how can we print color text in java applet.
In this  program I have used different methods to print text in java applet.
for example in Strings, with veriables etc.


import java.applet.*;
import java.awt.*;
import java.awt.event.*;
/*


*/

public class third extends Applet
{
String msg="";

public void init()
{
setBackground(Color.blue);
setForeground(Color.red);

msg="hi...";
System.out.print("nt"+msg);
}
public void start()
{
msg=msg+"whts up????";
}
public void paint(Graphics g)
{
msg=msg+"i hope u r enjoying an applet...";
g.drawString(msg,25,25);
}
}

Leave a Reply

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