java programming lecture 1
Download
Skip this Video
Download Presentation
Java Programming Lecture 1

Loading in 2 Seconds...

play fullscreen
1 / 17

Java Programming Lecture 1 - PowerPoint PPT Presentation


  • 67 Views
  • Uploaded on

Java Programming Lecture 1. Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung U niversity email: cheng@cse.tt u .edu.tw http:/ / www.cse.ttu.edu.tw/~cheng. Contents (chapter 1). Short History Java Development tools

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Java Programming Lecture 1 ' - niles


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
java programming lecture 1

Java Programming Lecture 1

Instructors:

Fu-Chiung Cheng

(鄭福炯)

Associate Professor

Computer Science & Engineering

Tatung University

email: cheng@cse.ttu.edu.tw

http:// www.cse.ttu.edu.tw/~cheng

contents chapter 1
Contents (chapter 1)
  • Short History
  • Java Development tools
  • Install JBuilder Tool and Samples
  • Getting Started With Java Programming
    • Compiling and Running a Java Application
    • Compiling and Running a Java Applet
history
History
  • James Gosling
  • Oak (Embedded consumer electronic appliances)
  • Java, May 20, 1995, Sun World
  • HotJava
    • The first Java-enabled Web browser
jdk versions
JDK Versions
  • JDK 1.02 (1995)
  • JDK 1.1 (1996)
  • Java 2 SDK v 1.2 (a.k.a JDK 1.2, 1998)
  • Java 2 SDK v1.3 (a.k.a JDK 1.2, 2000)
  • Java 2 SDK v1.4 (Dec. 2001)
  • Java 2 SDK v1.5 (June 2003 ??)
java development tools
Java Development Tools
  • Sun JDK
  • Inprise JBuilder (RAD)
  • Microsoft Visual J++
  • Symantec Café (RAD)
  • Rouge Wave JFactory
  • Sun Java Workshop
  • IBM Visual Age for Java (RAD)
install jbuilder and samples
Install JBuilder and Samples
  • Install JBuilder
  • Install Sample Programs
  • Setup JDK 1.2.2 environment
    • Set classpath=%classpath%;c:\jbbook
    • Set path=%path%;c:\jdk1.2.2\bin
  • Check Java Home:
    • www.javasoft.com
getting started with java programming
Getting Started with Java Programming
  • A Simple Java Application
  • Compiling Programs
  • Executing Applications
  • A Simple Java Applet
  • Viewing Java Applets
  • Applications vs. Applets
a simple application
A Simple Application

Example 1.1

//This application program prints Welcome

//to Java!

public class Welcome

{

public static void main (String[] args)

{

System.out.println("Welcome to Java!");

}

}

Source

Run

compiling programs
Compiling Programs
  • On command line
    • javac file.java
executing applications
Executing Applications
  • On command line
    • java classname
example
Example

javac Welcome.java

java Welcome

output:...

a simple applet
A Simple Applet

Example 1.2

/* This is an example of Java applets */

import java.awt.Graphics;

public class WelcomeApplet

extends java.applet.Applet {

public void paint (Graphics g) {

g.drawString("Welcome to Java!",10,10);

}

}

Source

creating an html file
Creating an HTML File

<html>

<body>

<applet code="WelcomeApplet.class"

width = 100 height = 40>

</applet>

</body>

</html>

applet viewer utility
Applet Viewer Utility

appletviewer htmlfile.html

Example:

appletviewer WelcomeApplet.html

Run Applet Viewer

applications vs applets
Applications vs. Applets
  • Similarities
  • Differences
security restrictions on applets
Security Restrictions on Applets
  • Applets are not allowed to read from, or write to, the file system of the computer viewing the applets.
  • Applets are not allowed to run any programs on the browser’s computer.
  • Applets are not allowed to establish connections between the user’s computer and another computer except with the server where the applets are stored.
ad