Monday, April 21, 2008

Application/Applet Development

Steps to create a Java Application:
1. Using any text editor (IDE), write Java application source code.
2. Compile the Java source code. When this is done, the Java compiler creates a byte-code file.
3. Invoke the Java Interpreter. It will run the byte-code file.
4. Debug as necessary, by invoking the Java debugger (jdb).

Step to create a Java Applet:

1.Using any text editor, write Java applet source code.
2.Compile the Java applet source code. The compiler creates a byte-code file.
3.Create an HTML document to contain the applet.
4. Invoke the byte-code file by specifying it in HTML document and then loading the HTML document.
5. Debug as necessary.

Writing Source Code

Writing Java source code is similar to writing source code in any other language. That is, an ASCII text editor is used to either add source code or modify it.

Following is a simple Java application. The source code would be entered into file named myFirstJavaApp.java:

class myFirstJavaApp {
public static void main (String[] args) {
System.out.println("This is my first Java Application");
}
}


The file containing Java source code must have the filename .java, where class-name is the name of the class in your Java source code.

2 comments:

Jemiro said...

wah, kalau say asih pakai eclipse ssebagai text editornya :D

Durante said...

Excellent post. Have you written any post for webfirmframework?