.:Welcome to our Java tutorials:.

Visit our Web design support Forum

by April Griffin

Nov 4, 2002

Your First Java Applet  "Lamers Suck" for the web.

 

Type EVERYTHING. The Java compiler  is case-sensitive, follow the code exactly.

Lets Begin.

Open Notepad. 

Select new Document

Type this exactly as it is shown here 

import java.applet.*;
import java.awt.*;
 
/**
 * The LamersSuck class implements an applet that
 * simply displays "Lamers Suck!".
 */
public class LamersSuck extends Applet {
    public void paint(Graphics g) {
        // Display "Lamers Suck!"
        g.drawString("Lamers Suck!", 50, 25);
    }
}
Save this code as LamersSuck.java
Create HTML file to accompany your applet turn around and
take the HTML tutorials as I suggested in the intro
if you don't know how yet. Use this HTML:
<HTML>
<HEAD>
<TITLE>Lamers Suck</TITLE>
</HEAD>
<BODY>
Everyone Knows That....
<APPLET CODE="LamersSuck.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>
Save as lamers.html.
Go to the DOS prompt like you did in lesson 1, if you 
haven't done lesson 1 turn around and do it. 
Type javac LamersSuck.java and click enter
The compiler will generate Java bytecode file, LamersSuck.class.
upload both LamersSuck.class. and lamers.html 
to the web. You have just made your first applet.
Now that you have made an Application and an 
Applet we are going to start learning what we did and why
over the next tutorials I just wanted you to start
 by making something right away so you could 
get a feel for it so the next part will make more sense. 

The next part is going to introduce the various parts of Java when we get through that we will make some more nifty lil progs.

 

 




   


EmpireSponsor .:is offering Awesome fully loaded Hosting starting at 5$ 500-2056 Megs PHP! CGI! ASP! SSL Secure Server SQL!
 

 

.:Tutorials:.

HTML
CSS
Javascript
Java
Flash
PSP
Support Forum
 

.:Tools:.

Free Search Engine Submission
Meta tag generator
 

.:Tests:.

CSS validator
HTML validator
Website Garage
HTML Doctor
 
.: Search :.
Need To Find Something Fast?
© 2002-2003 Empireezine.tripod.com