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

 

 

                                                

 

JAVA in SDK Environment

Guidelines
either download the development kit or install from cd
when installing , like most installations it will ask for folder
let the system put it in a folder or choose your own
for sake of discussion I assume you used 'JAVA' folder
after installation there will be a 'BIN' folder in 'JAVA' folder
'CD\JAVA\BIN' is the only DOS command you need to know
copy and paste some application or applet from our site
into Notepad ( no package names )
choose File  SaveAs and give it a name in quotes with
JAVA extension   eg.   "testone.java"...Use the same name 
you gave to the class or applet in the source code
make sure the destination is    C:\JAVA\BIN
any new applications or applets that you are writing from
scratch can be written directly in Notepad or directly in
a text Editor called 'EDIT' in the DOS environment
to get to DOS choose accessories   command or dos prompt
when in DOS type  CD\JAVA\BIN
you are now in the place where you compile, fix, edit, and
run your application and applets
to compile your application or applet type JAVAC name.JAVA
where name is your application or applet name
any errors will be noted. Use EDIT name.JAVA to bring up
the editor so you can fix errors -- remember to save after fixing
keep compiling until there are no syntax errors
run the application by typing JAVA name
make sure that no package name is at the top of your 
code if you coming from jbuilder
applets are slightly different because you have to create
a simple HTML file that calls youe applet
you can type this HTML file right in the DOS editor but be
sure to name it   file_name .html
sample html file to type into the editor

                 <HTML>
                 <HEAD>
                 <TITLE> A SIMPLE PROGRAM </TITLE>
                 </HEAD>
                 <BODY>
                 Here is the output of my program:
                 <APPLET CODE="APPLETNAME.CLASS" WIDTH=150 
                         HEIGHT=100 >
                 </APPLET>
                 </BODY>
                 </HTML>

SDK provides a program called  appletviewer that allows
you to run and see your applet
after leaving Editor type in the following to run your applet
type in appletviewer file_name.html
a sample html file to run your applet could be found at

           http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html