Preview:
import java.applet.*; 

import java.awt.*; 

/*<applet code="LabTask34.class" width="500" height="500"> 

</applet>*/ 

public class LabTask34 extends Applet 

{ 

 String str; 

public void init() 

 { 

str="Welcome to Java Applet"; 

System.out.println("Inside init method"); 

setBackground(Color.cyan); 

setForeground(Color.blue); 

 } 

public void start() 

 { 

System.out.println("Inside start method"); 

 } 

public void paint(Graphics g) 

 { 

 Font f=new Font("Arial",3,27); 

g.setFont(f);
   g.drawString(str,200,200); 
System.out.println("Inside paint method"); 
 } 
public void stop() 
 { 
System.out.println("Inside stop method"); 
 } 
public void destroy() 
 { 
System.out.println("Inside destroy method"); 
 } 
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter