Download presentation
Presentation is loading. Please wait.
1
Chapter Two Applet vs. Application
A first Java Program Chapter Two Applet vs. Application
2
Both types of programs Applet - Part of web page (can test w/o web page but need browser or applet viewer) Application - free standing program w/ purpose inventory, billing, payroll etc. etc.
3
How to start IDE (desktop) a help to complete the process
J++, Jbuilder - Windows based JDK - DOS based Operating Systems DOS, Windows, UNIX Line vs. GUI
4
Libraries of commands used by everyone all the time
copy print save edit file - LOTS MORE TOO….
5
Files - all types WP documents (letters, memos) Java Programs
“pure” data data bases Drive:filename. Extension Folders - sub directories -paths
6
Filing System - How to: Create display group run find
7
Editors Various create, retrieve, delete text, insert text, move, copy, search
8
Programs to help use Java
Editor - create source program Compiler - create Class file (from source) Linker - pulls in libraries Appletviewer - or browser to view Applets
9
Text of a Java Program import java.awt.*; import java.applet.Applet;
public class Greeting extends Applet { public void paint (Graphics g) { g.drawString(“Hello” , 50, 50); }}
10
WARNINGS Case must match (uppercase/lowercase)
File name must be same as class file name Spelling - braces - punctuation Greeting.java NOT greeting.java
11
Compile (with JDK) javac Greeting.java Common syntax errors (review)
If no errors java Greeting (if Application) appletviewer Greeting.html
12
HTML File Greeting.html (other names possible)
<title> Web page applet </title> <applet “code = Greeting.class” width = 300 height = 200> </applet>
13
After HTML created/saved
Appletviewer Greeting.html watch the applet appear
14
The libraries used Like Math when using square root or tan, cos, sine etc. import java.applet.Applet java = entire language applet = superclass Applet = needed for your Greeting program import java.awt.*; =Abstract Windowing Tool * = wildcard.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.