iSelfSchooling.com - Copyright © 1999-2009 iSelfSchooling.com ||  References  |  Job Openings
    Home  | Search more...  |  FREE Online VIDEO Oracle Training 

    Oracle Syntax  | Suggestions  | Private Tutoring

  Copyright & User Agreement

Email2aFriend  | Homepage us! |  Bookmark

Services

 Vision/Mission

 Services

 Biography

 Contact Us

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

Oracle SYNTAX

 Oracle Functions

 Oracle Syntax

 Oracle 10g Syntax

  PL/SQL Syntax

UNIX and more...

 UNIX for DBAs

 LINUX for DBAs

 DB using PHP

  A+ Certification

 Basics of JAVA  

 Tips of  SEO

Finance/Jobs

 Financial Aid

 Skilled

 Oracle

 Jobs

  Magazine

More Training

 Q & Answers

 SQL-PL/SQL

 DBA

 Developer

 Important Notes

 Case Studies

 9i New Features

 10g New Features

 10g Qs/As

 Grid Control

 OracleAS # I

 OracleAS # II

  LDAP and OID

  HTTP Server

 Instructor-Led

  Virtual Hosts

 Community Sharing

More to know...

Acknowledgement**

 FREE Legal Forms

 Who is who

 Market Place

 University Directory

 Advisory Articles

 Links...

 

 

JAVA for Oracle Developers

Basic Steps to write, compile, and run a JAVA applet

 

More Resources by Google:

 

Gathered By: John Kazerooni

How to write a JAVA applet?

A JAVA applet is not a standalone program and need JAVA runtime to run. You can run a JAVA applet using your browser. Your browser should have JAVA runtime and be enabled. You can also use the Applet Viewer included in the SDK.

Now, write a JAVA applet called IamSelfBuilder to display “I am a self builder!”

 

Step #1: Write and Create a JAVA applet source file

Use the notepad editor.  Write, your program, IamSelfBuilder, to display the “I am a self Builder!” message as a JAVA applet program.

Then save your JAVA applet as “c:\IamSelfBuilder.java” within the double quote and exit from notepad. Be careful what you type. Notice that the JAVA compiler and interpreter are very case-sensitive.

 

Notice that the bold characters in the following listing are comments.

 

import java.applet.*;

import java.awt.*;

 

/***************************************************

 * The IamSelfBuilder class implements an applet that

 * simply displays "I am a self builder!".

 ***************************************************/

public class IamSelfBuilder extends Applet {

    public void paint(Graphics g) {

        // Display "I am a self builder!"

        g.drawString("I am a self builder!", 50, 25);

    }

}

 

Step #2: Compile your JAVA applet source program

Go to the MS-DOS or Command prompt and change your current directory to the directory where you saved the JAVA source program. Remember that the JAVA compiler be in your path. If it is not, then set the path (set PATH=your java path/bin).

 

Example: MS-DOS> c:\java folder\bin\javac IamSelfLearner.java

If there are no errors, then you have successfully compiled your JAVA applet program. Now, you have generated a JAVA applet bytecode file, IamSelfBuilder.class. Now that you have the class file (a JAVA bytecode file), you can run your program. This file can run using your browser.

 

 

Step #3: Write an HTML file

Now, you should write an HTML file to accompany your applet. Use the notepad editor.  Save it as c:\IamSelfBuilder.html.

 

<HTML>

<HEAD>

<TITLE><CENTER>

An example of my first JAVA applet program

</CENTER></TITLE>

</HEAD>

 

<BODY>

This is my first JAVA applet:

<APPLET CODE="IamSelfBuilder.class" WIDTH=300 HEIGHT=50>

</APPLET>

</BODY>

</HTML>

 

Step #4: Run the JAVA applet Program

You can either view your applets by using your web browser or appletviewer application.

On your web browser, simple open your browser and type your html program.

For example: c:\IamSelfBuilder.html

 

To use the appletviewer application, go to MS-DOS and type appletviewer IamSelfBuilder.html

For example:

MS-DOS>cd /

MS-DOS>appletviewer IamSelfBuilder.html

 

And your should see your applet works.

If you got the “I am a self builder” message then your program works. Congratulations!

If not, then make sure that your are in the “class” folder or you might have to change your CLASSPATH variable (set CLASSPATH=).

 

 
 
Google
 
Web web site