import java.applet.*; 
import java.awt.*; 

//*******************************************************
//*                                                     *
//*     Autor: Dieter Bollinger, Stuttgart, Germany     *
//*                                                     *
//*******************************************************

public class helloworldc extends Applet 
{ 
	private String str = "Java Applet - Hello World !";	
	private String version = "";	
	private Image	bild;
   	private	MediaTracker tracker;

   	public void init()
   	{
		version = "Java-Version: " + System.getProperty( "java.version");
   		bild = getImage(getCodeBase(), "hello.gif");
		tracker = new MediaTracker(this);
   		tracker.addImage(bild, 1);
   		try {	tracker.waitForID(1); } 
    	catch (InterruptedException e)
    	{ }	
	}
	
	public void paint(Graphics theGraphic) 
	{ 
		theGraphic.setFont( new Font("sanserif", Font.BOLD, 15));
		FontMetrics fm = theGraphic.getFontMetrics();
		theGraphic.drawImage(bild, 0, 0, 300, 200, null);
		theGraphic.setColor(Color.black);  
		theGraphic.drawString(str,(300-Math.max(0, fm.stringWidth(str)))/2,30); 
		theGraphic.drawString(version,(300-Math.max(0, fm.stringWidth(version)))/2, 184); 

	} 
} 


