[Top] [Prev] [Next] [Bottom] [Contents]

Your First Java Applet-HelloWorld.java

As we have said above, we will not require you to learn Java nor to be able to compile Java source into byte code here. Instead, the point of this tutorial is to teach you how to use applets that already exist. For this reason, we provide both the .java source (for you to understand the applet if you wish) and the .class byte code (to actually use in your project).

The Code to HelloWorld.java

import java.awt.*;
public class HelloWorld extends java.applet.Applet 
{
	Font f = new Font("TimesRoman", Font.BOLD, 36);
	public void paint (Graphics g)
	{
		g.setFont(f);
		g.setColor(Color.red);
		g.drawString("Hello Again !", 5, 25);
	}
}

What Does It Do?



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.