Professor Kit Romano's Web Site

 



Site Index

About Me

Welcome
Definition of Program
Variable Types
Understanding Memory
Declaring Variables
Simple Commands
Concatenation and Strings
Sleep-Threads-Try Catch
Campus Scenes
Pictures
Java simplified
Application Shell Styles
Reading Data From File
Overview of Applets
Excellent Graphics Applet
Online Reference
Nested if statements
Arrays
Sorting Arrays
Using Strings
Functions
Top 20 Replies 
First program 211
Important Class Example
JAVA in SDK Environment
Understanding OOP
OOP simple example
Recursion example
Example of Inheritance
     and use of JTextArea



*** Web Related **********
Build Student Web Page ?
What is FTP
Download WS ftp95
Download Java Plug In
Applets from jbuilder to sdk
Practice Problems

 

Programming Examples

 

 

                                                

 

Applets in JBuilder

Rules on posting an applet to your web site using JBuilder to compile the applet

In following these steps you must be very aware of directories, file names, and file extensions. Also be aware of case sensitivity in naming files.

A student sent me a file with a java extension and here is exactly what I did to post it to the web

1 I double clicked on the attachment and JBuilder opened it

2 I removed the package name from the file and copied the rest the to windows clipboard

3 I closed JBuilder

4 Reopened JBuilder

5 Chose FILE NEW APPLET

6 Clicked finish all the way through and used the system defaults (In this process I had the first box checked (use only core and swing classes)

7 Clicked on the Applet1.java file node.

8 Delete all the code but the package name

9 Paste the code that I copied earlier from the email

10 Run the Applet and it drew a house on the screen

11 Close the Applet

12 Remove the package name at the top of the code

13 Run the Applet again

14 By removing the package name, a class file is built called Applet1 and is found under

c\JBuilder3\myclasses. This file name will be all by itself (obvious)

15 This file is your class file that you will copy to the web

16 Under myclasses you will see a lot of untitled folders from earlier projects. Do not concern yourself with these

17 Move this class file to a safe place to ftp later.

18 Close JBuilder3 (remember that the package name has been removed for future reference) You can save your changes if you want (up to you)

19 Use Notepad to type in a simple web page as follows:

<HTML>

<HEAD>

<TITLE> A SIMPLE PROGRAM </TITLE>

</HEAD>

<BODY>

Here is the output of my program:

<APPLET CODE="Applet1.class" WIDTH=600

HEIGHT=400 >

</APPLET>

</BODY>

</HTML>

20 Save this code as "first.htm" in a location where you can find it for FTP purposes

21 Be sure to make you width and height big enough for your own applets later

22 Since most of you have an Applet1.class file on your site and if you FTP this new Applet over it will over write your old one, here is what I recommend

23 Make a new folder on your web site called "FIRSTAPPLET"

24 Change to that folder

25 FTP your 2 new files to that folder

26 Close FTP

27 Open Explorer and type the path to the new htm file. In my case here is what I typed:

webpages.shepherd.edu/JROMANO/FIRSTAPPLET/clay.htm

clay was the name I used for the htm file but if you followed the steps above you

will use     first      instead of clay